Renaming Excel Spreadsheets

2008-08-26 Thread James Matthews
-- Forwarded message -- From: Waldemar Osuch <[EMAIL PROTECTED]> Date: Tue, Aug 26, 2008 at 7:59 PM Subject: Re: [python-win32] Fwd: Renaming Excel Spreadsheets To: Python-Win32 List <[EMAIL PROTECTED]> On Tue, Aug 26, 2008 at 12:57 PM, James Matthews <[EMAIL PROTECTED]> wrote: >

Baume & Mercier Hampton Ladies Watch 8440 Recommendation Discount Watches

2008-08-26 Thread hualibao004
Baume & Mercier Hampton Ladies Watch 8440 Recommendation Discount Watches Baume & Mercier Hampton Ladies Watch 8440 Site: http://baume-mercier-watches.pxhelp.com/Baume-Mercier-wristwatch-165.html Thank you for choosing http://www.pxhelp.com/ Quality Baume & Mercier Watches: http://baume-mercier-

Re: atomic increment

2008-08-26 Thread Paul Rubin
Frank Millman <[EMAIL PROTECTED]> writes: > Just out of interest, would the following, without a lock, be safe? > old, atomic_int = atomic_int, atomic_int+1 No I don't think so. But I'm told that in CPython, you can say counter = iter(xrange(1000)) # some number that exceeds wh

Re: ctypes: loading .so file on Linux

2008-08-26 Thread castironpi
On Aug 27, 12:03 am, Paddy <[EMAIL PROTECTED]> wrote: > On Aug 23, 2:33 pm, Paddy <[EMAIL PROTECTED]> wrote: > > Hi, > > I am am falling at the first hurdle when trying to access a library > > using ctypes. > > > I have a file libucdb.so which the file command says is shared object, > > but I canno

Re: atomic increment

2008-08-26 Thread Frank Millman
On Aug 26, 5:56 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Alexandru  Mosoi wrote: > > how can i do an atomic read+increment? something like > > > with lock: > >    old = atomic_int > >    atomic_int += 1 > > > but in one operation > > As above - the lock (under the assumption that it is a

Re: Struct class random access

2008-08-26 Thread castironpi
On Aug 26, 12:41 am, castironpi <[EMAIL PROTECTED]> wrote: > On Aug 25, 11:47 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > > > On Mon, 25 Aug 2008 14:49:14 -0700, castironpi wrote: > > > I'm interested in the speed benefit, so you don't have to reconstruct > > > the entire 'record' jus

Re: ctypes: loading .so file on Linux

2008-08-26 Thread Paddy
On Aug 23, 2:33 pm, Paddy <[EMAIL PROTECTED]> wrote: > Hi, > I am am falling at the first hurdle when trying to access a library > using ctypes. > > I have a file libucdb.so which the file command says is shared object, > but I cannot get it to load: > > Any help would be appreciated: > > dmccarthy

Re: Extracting path of a program from a list.

2008-08-26 Thread Gabriel Genellina
En Wed, 27 Aug 2008 01:15:58 -0300, aditya shukla <[EMAIL PROTECTED]> escribi�: I wanna know how can i extract path of a program whose path i have added to the PATH variable. This is what i have done import os x=os.getenv("PATH") print x %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\

Tkinter Unix and Windows incompatibility

2008-08-26 Thread akineko
Hello everyone, I'm trying to create custom Tkinter/Pmw widgets for my project. After testing my widgets under Unix (Solaris), I have tried them under Windows and I got a surprise. The widgets came out differently. The following simple code snippet demonstrates the difference: root = Tk()

Re: floating point arithmetic

2008-08-26 Thread Gabriel Genellina
En Tue, 26 Aug 2008 18:11:30 -0300, fred8865 <[EMAIL PROTECTED]> escribi�: I understand that due to different arithmetic used in floating points they are just approximations. Hence, 180/100=1 in my python interpreter. How can I tackle this problem of inaccurate floating point numbers? thank you

Re: Identifying the start of good data in a list

2008-08-26 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: I have a list that starts with zeros, has sporadic data, and then has good data. I define the point at which the data turns good to be the first index with a non-zero entry that is followed by at least 4 consecutive non-zero data items (i.e. a week's worth of non-zero da

Re: Memory Leak?

2008-08-26 Thread Gabriel Genellina
En Tue, 26 Aug 2008 23:27:45 -0300, Kevin McKinley <[EMAIL PROTECTED]> escribi�: So i've complete my first program with a GUI interface. I've noticed that everytime i click a tab or button the amount of memory the program takes up goes up by 50-200 kb. The program will start off at 4.5mb

Re: python multitask

2008-08-26 Thread Gabriel Genellina
En Tue, 26 Aug 2008 11:50:04 -0300, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribi�: Hi ! I want use many comands in same python script . I want to use openoffice and pyuno . I try this cmdoo="openoffice.org -accept='socket,host=localhost,port=2002;urp;'" subprocess.call(cmdoo, shell=True) bu

Re: Setting my Locale

2008-08-26 Thread Gabriel Genellina
En Tue, 26 Aug 2008 07:52:21 -0300, Robert Rawlins <[EMAIL PROTECTED]> escribi�: I'm running python 2.5 on a Debian based system and I'm looking for your advice on how to set the locale for my application. I've read through the locale module documentation http://docs.python.org/lib/module-loca

Re: Ctypes module - looking for a way to dynamically call exported function from a set of dlls

2008-08-26 Thread Gabriel Genellina
En Tue, 26 Aug 2008 07:42:50 -0300, <[EMAIL PROTECTED]> escribi�: Hi, I'm using the ctypes module to load my dlls. I have some 10 dlls the names of those are passed to a fucntion which then loads the passed dll. Now every dll has a getversion function. eg: A.dll, B.dll, C.dll are the dlls and

Extracting path of a program from a list.

2008-08-26 Thread aditya shukla
Hello folks, I wanna know how can i extract path of a program whose path i have added to the PATH variable. This is what i have done import os x=os.getenv("PATH") print x >>%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;c:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Pr

Re: Retrieve Win32 domain name

2008-08-26 Thread Gabriel Genellina
En Tue, 26 Aug 2008 05:39:55 -0300, Salim Fadhley <[EMAIL PROTECTED]> escribi�: I'm looking for a method to retrieve a Windows Domain name (not a DNS Domain name). I know this can be done by simply reading an environment variable, however on the machines I need to work with sometimes the envi

Re: Python + Mac Help

2008-08-26 Thread Benjamin Kaplan
On Tue, Aug 26, 2008 at 11:07 PM, William Purcell <[EMAIL PROTECTED] > wrote: > FYI...I found the site that I installed from besides MacScience. I think > that I have installed just about everything on this site. > http://www.pythonmac.org/packages/py25-fat/index.html > > > On Tue, Aug 26, 2008 at

Re: What's your first choice if you have to write a C module for python?

2008-08-26 Thread Carl Banks
On Aug 26, 8:19 am, 一首诗 <[EMAIL PROTECTED]> wrote: > What's your first choice when you have write a C/C++ module for Python? 1. Plain C code 2. Implement my own C extension code generator in Python 3. ctypes ... ... Infinity. SWIG Carl Banks -- http://mail.python.org/mailman/listinfo/python-lis

Re: Non-evil multithreaded WSGI server?

2008-08-26 Thread Gabriel Genellina
En Tue, 26 Aug 2008 03:20:53 -0300, Gerhard Häring <[EMAIL PROTECTED]> escribi�: In a recent experiment I've done this: from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler from wsgiref.simple_server import make_server, demo_app from SocketServer import ThreadingMixIn # Let's make a

Re: Need help with extension modules built in debug mode

2008-08-26 Thread Gabriel Genellina
En Tue, 26 Aug 2008 01:11:10 -0300, <[EMAIL PROTECTED]> escribi�: I've come to the conclusion that posting about Embedded Python on the Python forums is a complete waste of time. I hope I can get some useful insights here. I'm looking for some help with extension modules built using Visual Stu

Re: Python + Mac Help

2008-08-26 Thread William Purcell
FYI...I found the site that I installed from besides MacScience. I think that I have installed just about everything on this site. http://www.pythonmac.org/packages/py25-fat/index.html On Tue, Aug 26, 2008 at 10:05 PM, William Purcell <[EMAIL PROTECTED] > wrote: > I am new to the Mac/OS X world.

Python + Mac Help

2008-08-26 Thread William Purcell
I am new to the Mac/OS X world. I am trying to get Python set up with Numpy, Scipy, Matplotlib, and wxPython. It seems that everything is working fine except Scipy. To explain my problem, it is probably best to see the following Simply trying to import Scipy...

Re: Python and database unittests

2008-08-26 Thread alex23
Daniel <[EMAIL PROTECTED]> wrote: > Does anyone know about a module that acts as a database stub for > python unittests? It's not database-specific, but the Mock module should help you here: http://python-mock.sourceforge.net/ There's even an example on that page for mocking a database. -- http:

Re: Identifying the start of good data in a list

2008-08-26 Thread Terry Reedy
Matthew Fitzgibbons wrote: [EMAIL PROTECTED] wrote: reHist = [0, 0, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9] count = 0 for i, d in enumerate(reHist): if d == 0: count = 0 else: count += 1 if count == 5: break else: raise Exception("No data found") reHist = re

Re: JSON from Python mysqldb

2008-08-26 Thread jpuopolo
On Aug 26, 3:15 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > jpuopolo wrote: > > All: > > > I am using Python to read some records from the MySQL database. I am > > using the mysqldb library, and things are working well. > > > Now, I would like to pass back the results of the query to a Web-based >

Utah Open Source Conference, August 28-30

2008-08-26 Thread jazbees
Apologies if this is too regional and not of interest to the broader Python community, but I felt I should pass along the link to an event I stumbled across today: http://2008.utosc.com/pages/home/ Some talks on the schedule are either directly about Python ("Vim and Python", "Using Lasers, Webca

Re: floating point arithmetic

2008-08-26 Thread Terry Reedy
John Machin wrote: On Aug 27, 7:11 am, fred8865 <[EMAIL PROTECTED]> wrote: I understand that due to different arithmetic used in floating points they are just approximations. Hence, 180/100=1 in my python interpreter. It's not "hence". What you are seeing is truncating integer division. H

Re: Identifying the start of good data in a list

2008-08-26 Thread tkpmep
On Aug 26, 7:23 pm, Emile van Sebille <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > I have a list that starts with zeros, has sporadic data, and then has > > good data. I define the point at  which the data turns good to be the > > first index with a non-zero entry that is followed by a

Re: sum up numbers in a list

2008-08-26 Thread Terry Reedy
sharon kim wrote: is there a way to sum up all the numbers in a list? >>> help(sum) sum(...) sum(iterable[, start]) -> value Returns the sum of an iterable of numbers (NOT strings) plus the value of parameter 'start' (which defaults to 0). When the iterable is empty, return

Re: Date Comparison and Manipulation Functions?

2008-08-26 Thread Benjamin Kaplan
On Tue, Aug 26, 2008 at 9:24 PM, W. eWatson <[EMAIL PROTECTED]> wrote: > John Machin wrote: > >> On Aug 27, 10:21 am, "W. eWatson" <[EMAIL PROTECTED]> wrote: >> >>> I'm using IDLE for Python 2.4, and put pfydate distribution in >>> C:\Python24\Lib\site-packages\pfydate, as required by the >>> pag

Memory Leak?

2008-08-26 Thread Kevin McKinley
So i've complete my first program with a GUI interface. I've noticed that everytime i click a tab or button the amount of memory the program takes up goes up by 50-200 kb. The program will start off at 4.5mb and by the time i'm done it can get up over 10 or 15 mb. The program will start runn

Re: Python Strinh Immutability Broken!

2008-08-26 Thread Terry Reedy
Hendrik van Rooyen wrote: Terry Reedy: Which essentially is the bytearray type of 3.0. How does it differ from plain old array.array(b,”The quick brown fox”)? The typecode must be quoted as 'b'. In 3.0, strings become unicode, so an added b prefix is needed. >>> import array >>> a = arr

Re: iterparse and unicode

2008-08-26 Thread George Sakkis
On Aug 25, 4:45 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > George Sakkis wrote: > > It depends on what you mean by "compatible"; e.g. you can't safely do > > [s.decode('utf8') for s in strings] if you have byte strings mixed > > with unicode. > > why would you want to decode strings given to yo

Re: Enhanced property decorator

2008-08-26 Thread Benjamin
On Aug 25, 9:00 pm, Daniel <[EMAIL PROTECTED]> wrote: > On 25 Aug, 21:52, Benjamin <[EMAIL PROTECTED]> wrote: > > > ... I think Python 2.6 may have > > want you want: > > > class A(object): > > >     @property > >     def my_prop(): return self._prop > > >     @my_prop.setter > >     def my_prop(pr

Environment variables

2008-08-26 Thread aditya shukla
Hello folks, How can i create environment variables using python? Aditya -- http://mail.python.org/mailman/listinfo/python-list

Re: Date Comparison and Manipulation Functions?

2008-08-26 Thread W. eWatson
John Machin wrote: On Aug 27, 10:21 am, "W. eWatson" <[EMAIL PROTECTED]> wrote: I'm using IDLE for Python 2.4, and put pfydate distribution in C:\Python24\Lib\site-packages\pfydate, as required by the page. How to install pyfdate. Save pyfdate.py into your PythonNN/Lib/site-packages direc

Re: Return a string result with out breaking loop

2008-08-26 Thread castironpi
On Aug 26, 11:46 am, Andrew <[EMAIL PROTECTED]> wrote: ... >          results = change_handle >          for action, files in results: >              full_filename = os.path.join(path_to_watch, files) >              theact = ACTIONS.get(action, "Unknown") >              out2 = str(full_filename) +

Re: Micro-threading PEP proposal announcement

2008-08-26 Thread Terry Reedy
Pau Freixes wrote: When can I read this PEP ? I'm interesting I wanted to make everybody aware that I've posted a (rather long and involved) PEP proposal for adding micro-threading to Python on python-ideas for feedback and review. Python-ideas is another mailing list at pytho

Re: Date Comparison and Manipulation Functions?

2008-08-26 Thread John Machin
On Aug 27, 10:21 am, "W. eWatson" <[EMAIL PROTECTED]> wrote: > > I'm using IDLE for Python 2.4, and put pfydate distribution in > C:\Python24\Lib\site-packages\pfydate, as required by the > page. > How to install pyfdate. > > Save pyfdate.py into your PythonNN/Lib/site-packages directory. > I

Re: why in returns values for array and keys for dictionary

2008-08-26 Thread Terry Reedy
Lie wrote: Anyway, there is two obvious choice when dealing with dictionary looping: return the keys and return the key and value. > The python designer thought... The issue of whether there should be a default iterator and if so, which of the two obvious choices should be picked, was discu

Re: Date Comparison and Manipulation Functions?

2008-08-26 Thread W. eWatson
[EMAIL PROTECTED] wrote: check out Pyfdate: http://www.ferg.org/pyfdate from pyfdate import * t = Time().add(hours=14) print "It is now", t.wdt datestring1 = "2005/10/05" #year,month,day datestring2 = "2002/09/22" #year,month,day datestring3 = "2007/11/11" #year,month,day year,month,day = num

Re: Return a string result with out breaking loop

2008-08-26 Thread Andrew
mmk guess I will have to look for alternate solutions for this project. Thank you all for your help cheers Andrew! Fredrik Lundh wrote: Andrew wrote: Yield returns the result I am looking for... however it does not continue looping. It does the same thing as return would the XML-RPC protoc

Free huge source codes collection

2008-08-26 Thread Albertos
Hello, I've collected huge source codes collection of any kinds : work with text files, database, GUI etc. You can download it here http://freactor.com/get.php?file=Python -- http://mail.python.org/mailman/listinfo/python-list

've collected huge source codes collection of any kinds

2008-08-26 Thread Albertos
Hello, I've collected huge source codes collection of any kinds : work with text files, database, GUI etc. You can download it here http://freactor.com/get.php?file=Python+source+code -- http://mail.python.org/mailman/listinfo/python-list

Re: Identifying the start of good data in a list

2008-08-26 Thread tdmj
On Aug 26, 5:49 pm, [EMAIL PROTECTED] wrote: > I have a list that starts with zeros, has sporadic data, and then has > good data. I define the point at which the data turns good to be the > first index with a non-zero entry that is followed by at least 4 > consecutive non-zero data items (i.e. a w

Re: extract text from ods TableCell using odfpy

2008-08-26 Thread norseman
Ciaran Farrell wrote: 2008/8/26 norseman <[EMAIL PROTECTED]>: frankentux wrote: Ok. Sorted it out, but only after taking a round trip over xml.minidom. Here's the working code: #!/usr/bin/python from odf.opendocument import Spreadsheet from odf.opendocument import load from odf.table import Ta

Re: Identifying the start of good data in a list

2008-08-26 Thread Emile van Sebille
[EMAIL PROTECTED] wrote: I have a list that starts with zeros, has sporadic data, and then has good data. I define the point at which the data turns good to be the first index with a non-zero entry that is followed by at least 4 consecutive non-zero data items (i.e. a week's worth of non-zero da

Re: Identifying the start of good data in a list

2008-08-26 Thread Mensanator
On Aug 26, 4:49 pm, [EMAIL PROTECTED] wrote: > I have a list that starts with zeros, has sporadic data, and then has > good data. I define the point at  which the data turns good to be the > first index with a non-zero entry that is followed by at least 4 > consecutive non-zero data items (i.e. a w

Re: What is class method?

2008-08-26 Thread Matthew Fitzgibbons
Medardo Rodriguez (Merchise Group) wrote: On Tue, Aug 26, 2008 at 4:10 PM, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: In Python, there's *no* relationship between classmethods and metaclasses. In OOP the concept of meta-class has everything to do with class methods, regardless if is in Pyt

Re: floating point arithmetic

2008-08-26 Thread fred8865
thanks guys fred8865 wrote: > Hi all, > > I understand that due to different arithmetic used in floating points > they are just approximations. Hence, 180/100=1 in my python interpreter. > How can I tackle this problem of inaccurate floating point numbers? > thank you > > regards > xtd -- http

Re: Python LDAP

2008-08-26 Thread Juan
On 26 ago, 13:42, Michael Ströder <[EMAIL PROTECTED]> wrote: > Juan wrote: > >     self.conn = ldap.initialize(self.host, self.port) >  > [..] > > LDAPError: (2, 'No such file or directory') > > You have to pass in a LDAP URI as documented > here:http://python-ldap.sourceforge.net/doc/html/ldap.ht

Re: Identifying the start of good data in a list

2008-08-26 Thread Matthew Fitzgibbons
[EMAIL PROTECTED] wrote: I have a list that starts with zeros, has sporadic data, and then has good data. I define the point at which the data turns good to be the first index with a non-zero entry that is followed by at least 4 consecutive non-zero data items (i.e. a week's worth of non-zero da

SQL package

2008-08-26 Thread Juan
Hi I am trying to write a little a script that can be configurable. This script should access to a database, that can be of any type (MySQL, Postgres, SQLite, MS, etc).It has only to perform 2 or 3 simple plain SQL queries. Hi have tested SQLAlchemy, and it is great, but too much for my requiremen

Re: Python and database unittests

2008-08-26 Thread Daniel
Hey gordy, Thanks for the reply. I am actually using sqlite in part of my application and I don't feel the need to stub that. Even though I don't use the in memory option, it is still zero configuration so I build up my database in each test then delete it. However, the way I interact with the

Re: Identifying the start of good data in a list

2008-08-26 Thread bearophileHUGS
Sorry, in the Psyco version replace this line: for i, el in enumerate(alist): With: for i in xrange(len(alist)): because Psyco doesn't digest enumerate well. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: logging - how to use in a library?

2008-08-26 Thread Ben Finney
Thomas Heller <[EMAIL PROTECTED]> writes: > If the script using the library does NOT configure logging, and > somewhere the library calls logger.error(...) or > logger.critical(...) then he gets a message on stderr saying: > > No handlers could be found for logger "foo" Right. So, part of the

Re: Identifying the start of good data in a list

2008-08-26 Thread bearophileHUGS
First solutions I have found, not much tested beside the few doctests: from itertools import islice def start_good1(alist, good_ones=4): """ Maybe more efficient for Python >>> start_good = start_good1 >>> start_good([0, 0, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) 4 >>> start_go

Re: smart quotes

2008-08-26 Thread Adrian Smith
On Aug 26, 4:13 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > Adrian Smith wrote: > > Can anyone tell me how to get rid of smart quotes in html using > > Python? I've tried variations on > > stuff = string.replace(stuff, "\“", "\""), but to no avail, presumably > > because they're not standard ASCII

Creating environment variables.

2008-08-26 Thread aditya shukla
Hello folks, I am writing a program(prog 1) in python , which requires to know the path of another program(prog 2) in order to execute.I can get my prog1 to work when i hard code the path of the existing program(prog2).But since the path of prog could be anywhere on the file system , thus i cannot

Re: File copying from a menu

2008-08-26 Thread Brandon
Turns out I was missing a few lines of code here-and-there, but now it's visible and working. Thanks to anyone who was looking into this for me. "Fredrik Lundh" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Brandon wrote: > >> I'm attempting to have a file copied from a menu se

Re: Python and database unittests

2008-08-26 Thread gordyt
Daniel I don't know if it would work for your situation or not, but if you are using Python 2.5, you could use the now built-in sqlite3 module. If you didn't even want to create a temporary database file you could use the special memory-only syntax like this: >>> import sqlite3 >>> conn =sqlite3.

Re: What's your first choice if you have to write a C module for python?

2008-08-26 Thread Christian Heimes
一首诗 wrote: Hi all, I read this interesting post comparing Boost.Python with Pyd: http://pyd.dsource.org/vsboost.html What's your opinion about it? What's your first choice when you have write a C/C++ module for Python? I'm using handwritten C code or Cython/Pyrex to create Python C extensi

Re: Read dbf file as read only

2008-08-26 Thread Ricardo Aráoz
ajak_yahoo wrote: Hi, How can I access a foxpro dbf file from my python program. I just want to read it as a read only file. Regards, Check Paul McNett's article in FoxTalk "Exploring Python from a Visual Foxpro Perspective" and check the code in : http://www.paulmcnett.com/vfp/09MCNES

RE: Adding Icons to my Programs

2008-08-26 Thread Support Desk
Take a look at this: http://www.velocityreviews.com/forums/t332696-setting-icon-using-py2exe.html -Original Message- From: Kevin McKinley [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 26, 2008 4:37 PM To: python-list@python.org Subject: Adding Icons to my Programs I've been turn my s

RE: Adding Icons to my Programs

2008-08-26 Thread Support Desk
Sincerely, Michael H. -Original Message- From: Kevin McKinley [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 26, 2008 4:37 PM To: python-list@python.org Subject: Adding Icons to my Programs I've been turn my script into executible programs with Py2exe. Is there a way to change the

RE: Adding Icons to my Programs

2008-08-26 Thread Support Desk
-Original Message- From: Kevin McKinley [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 26, 2008 4:37 PM To: python-list@python.org Subject: Adding Icons to my Programs I've been turn my script into executible programs with Py2exe. Is there a way to change the icon for the main exe file

Re: What is class method?

2008-08-26 Thread Raymond Hettinger
On Aug 24, 5:32 am, Hussein B <[EMAIL PROTECTED]> wrote: > Hi, > I'm familiar with static method concept, but what is the class method? > how it does differ from static method? when to use it? I use them when I need alternative constructors for a class. class Angle(object): def __init__(self,

Re: Decorators using instance variables

2008-08-26 Thread Robert Kaplan
Bruno Desthuilliers a écrit : <...> 2/ don't bother reading anything from someone named 'castironpi', it's one of our currently active resident troll, and he is worse than clueless. Actually, I found his response to the point, his sample code helpful, and his solution similar to yours.

Re: FW: Using Python to shared memory resources between Linux and Windows

2008-08-26 Thread Emile van Sebille
Blubaugh, David A. wrote: Diez, What you have said is extremely concerning. I am now using VMware. With Linux as the Master and windows as the guest operating system. I was wondering if you have ever had to develop a share memory resource between Linux and windows within a Vmware setup?

Re: What is class method?

2008-08-26 Thread Medardo Rodriguez (Merchise Group)
On Tue, Aug 26, 2008 at 4:10 PM, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > In Python, there's *no* relationship between classmethods and metaclasses. In OOP the concept of meta-class has everything to do with class methods, regardless if is in Python, SmallTalk or CLOSS. "classmethod" decor

Identifying the start of good data in a list

2008-08-26 Thread tkpmep
I have a list that starts with zeros, has sporadic data, and then has good data. I define the point at which the data turns good to be the first index with a non-zero entry that is followed by at least 4 consecutive non-zero data items (i.e. a week's worth of non-zero data). For example, if my lis

FW: Using Python to shared memory resources between Linux and Windows

2008-08-26 Thread Blubaugh, David A.
Diez, What you have said is extremely concerning. I am now using VMware. With Linux as the Master and windows as the guest operating system. I was wondering if you have ever had to develop a share memory resource between Linux and windows within a Vmware setup? Thanks for the help. It wil

RE: Using Python to shared memory resources between Linux and Windows

2008-08-26 Thread Blubaugh, David A.
Diez, What you have said is extremely concerning. I am now using VMware. With Linux as the Master and windows as the guest operating system. I was wondering if you have ever had to develop a share memory resource between Linux and windows within a Vmware setup? Thanks for the help. I will

Python and database unittests

2008-08-26 Thread Daniel
Hello, I'm writing an application that interacts with a database. As I think about how to write the unittests, I want them to be able to run without actually having to access a live database. The pattern that best describes this is here: http://martinfowler.com/eaaCatalog/serviceStub.html I ha

Adding Icons to my Programs

2008-08-26 Thread Kevin McKinley
I've been turn my script into executible programs with Py2exe. Is there a way to change the icon for the main exe file? Thank you, Kevin McKinley -- http://mail.python.org/mailman/listinfo/python-list

Re: floating point arithmetic

2008-08-26 Thread John Machin
On Aug 27, 7:11 am, fred8865 <[EMAIL PROTECTED]> wrote: > I understand that due to different arithmetic used in floating points > they are just approximations. Hence, 180/100=1 in my python interpreter. It's not "hence". What you are seeing is truncating integer division. > How can I tackle this

Re: floating point arithmetic

2008-08-26 Thread Mensanator
On Aug 26, 4:11 pm, fred8865 <[EMAIL PROTECTED]> wrote: > Hi all, > > I understand that due to different arithmetic used in floating points > they are just approximations. Hence, 180/100=1 in my python interpreter. > How can I tackle this problem of inaccurate floating point numbers? Try actually

Re: floating point arithmetic

2008-08-26 Thread Rob Clewley
> I understand that due to different arithmetic used in floating points > they are just approximations. Hence, 180/100=1 in my python interpreter. No, that's not the reason you get 1, it's because the current version of python does integer division by default. Try doing 180.0/100 or including fro

RE: libxml2dom - parsing maligned html

2008-08-26 Thread bruce
hi paul... so you're the guy behind the libxml2dom ehh..!! glad to say hey! so this really is an issue with libxml2dom. ok, good, at least i know where the issue is. and yeah, i know the real issue is the fact that the html isn't valid!! shouldn't have multiple "html" trees... from what i can te

floating point arithmetic

2008-08-26 Thread fred8865
Hi all, I understand that due to different arithmetic used in floating points they are just approximations. Hence, 180/100=1 in my python interpreter. How can I tackle this problem of inaccurate floating point numbers? thank you regards xtd -- http://mail.python.org/mailman/listinfo/python-list

Re: Using Python to shared memory resources between Linux and Windows

2008-08-26 Thread Diez B. Roggisch
Blubaugh, David A. schrieb: To All, To whom else if I may ask? I was wondering if it was possible to utilize python to share a memory resource between a linux and windows system?? It should be stated that both the Linux (CENTOS 5) and windows are physically located on the same computer. Is

Re: Decorators using instance variables

2008-08-26 Thread Bruno Desthuilliers
Bruno Desthuilliers a écrit : robert2821 a écrit : (snip - sorry, hit the 'send' button too soon) def getdec(f): dec = decorator(f) return dec.docall class decorator: def __init__ (self, f): self.f = f def docall (self, *a): return self.f(*a) class test: @ge

Re: extract text from ods TableCell using odfpy

2008-08-26 Thread John Machin
On Aug 27, 3:04 am, norseman <[EMAIL PROTECTED]> wrote: > frankentux wrote: > > Ok. Sorted it out, but only after taking a round trip over > > xml.minidom. Here's the working code: > > > #!/usr/bin/python > > from odf.opendocument import Spreadsheet > > from odf.opendocument import load > > from od

Re: Programmatically exit the REPL

2008-08-26 Thread Matthew Fitzgibbons
Matthew Fitzgibbons wrote: I've got a pretty complex interactive command line program. Instead of writing my own REPL, I'm using the Python interpreter (an infinitely better solution). This program has two threads, a background thread and the REPL thread. When you call quit() or sys.exit() in t

RE: The Importance of Terminology's Quality

2008-08-26 Thread Phil Runciman
Apologies: By the time my posts have been added the discussion has moved on a lot. I have to make a correction too. It was not a System 4 machine but an ICL 2900 series (Once known as the New Range Series). Hey it was a long time ago and I have moved countries 4 times since then and anno domini

Re: Decorators using instance variables

2008-08-26 Thread Bruno Desthuilliers
robert2821 a écrit : Hi, I'm new; greetings all! Hello. Since you're new here, first a couple advises: 1/ the python mailing list is relayed to the comp.lang.python usenet newsgroup (from where I'm reading your post and answering it), so please avoid attachments. Either put the full code i

Using Python to shared memory resources between Linux and Windows

2008-08-26 Thread Blubaugh, David A.
To All, I was wondering if it was possible to utilize python to share a memory resource between a linux and windows system?? It should be stated that both the Linux (CENTOS 5) and windows are physically located on the same computer. Is any of this possible? Thanks, David Blubaugh

Re: Books about Python.

2008-08-26 Thread Mike Driscoll
On Aug 24, 10:32 pm, [EMAIL PROTECTED] wrote: > I'm up to write a 20-30 research paper for my computer science course, > and I was considering choosing to do mine on Python.  I was curious if > anybody knows of any good books about python they could recommend that > have more of a technical view ra

Re: What is class method?

2008-08-26 Thread Bruno Desthuilliers
Hussein B a écrit : Hi, I'm familiar with static method concept, Which is more often than not useless in Python - we have true functions and modules. but what is the class method? Short answer : It's a method that can be looked up upon both the class or an instance of it, and takes the c

Re: Programmatically exit the REPL

2008-08-26 Thread Matthew Fitzgibbons
Almar Klein wrote: Hi, If you insist on writing your own shell, you can also consider running the commands in another python process. I took the source code of Pype as an example, which uses a wx.Process. I've tried the subprocess module as well, but could not get it to work. Almar 2008/8/2

Re: What is class method?

2008-08-26 Thread Bruno Desthuilliers
Medardo Rodriguez (Merchise Group) a écrit : On Sun, Aug 24, 2008 at 4:32 AM, Hussein B <[EMAIL PROTECTED]> wrote: I'm familiar with static method concept, but what is the class method? how it does differ from static method? when to use it? "Class Methods" are related to the meta-class concept

Re: dynamically adding some of one module's functions to another

2008-08-26 Thread Bruno Desthuilliers
Gabriel Rossetti a écrit : Hello everyone, I'm trying to import some modules into another's namespace (network_utils) network_utils.py: import utils import constants as main_const from services import constants as srv_const from plugins import constants as plg_const # # Import all the message

struct.Struct random access

2008-08-26 Thread castironpi
I'd like to seriously nominate this idea and get a considered opinion on it. struct.Struct lets you encode Python objects into structured memory. It accepts a format string, and optionally a buffer and offset to/from which to read/write the structure. What do you think of random access to the res

RE: Renaming Excel Spreadsheets

2008-08-26 Thread Reedick, Andrew
Excel object model: http://msdn.microsoft.com/en-us/library/bb149081.aspx I think the Sheets object is where you add more sheets to a workbook. You can google for code examples on how to use COM with Excel. You don't have to limit yourself to Python code examples since COM

Re: Renaming Excel Spreadsheets

2008-08-26 Thread Emile van Sebille
Greg Lindstrom wrote: Hello, I am working with Python to create Excel spreadsheets and have run into a couple of problems I hope you can help me with. First...are there any bindings/libraries into Open Office? Now, back to Excel. --> Does anyone know a way to create N worksheets? By defau

Re: JSON from Python mysqldb

2008-08-26 Thread Larry Bates
jpuopolo wrote: All: I am using Python to read some records from the MySQL database. I am using the mysqldb library, and things are working well. Now, I would like to pass back the results of the query to a Web-based front end, and I would like to use JSON. Is there a library/example of creatin

Re: Are dictionaries the same as hashtables?

2008-08-26 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: >Cameron Laird wrote: > >> In article <[EMAIL PROTECTED]>, >> Diez B. Roggisch <[EMAIL PROTECTED]> wrote: >>>Martin Marcher wrote: >>> On 2008-08-26 00:32:20, cnb wrote: > Are dictionaries the same as hashtables? >

JSON from Python mysqldb

2008-08-26 Thread jpuopolo
All: I am using Python to read some records from the MySQL database. I am using the mysqldb library, and things are working well. Now, I would like to pass back the results of the query to a Web-based front end, and I would like to use JSON. Is there a library/example of creating a JSON array fro

logging - how to use in a library?

2008-08-26 Thread Thomas Heller
I'm using the logging module in my comtypes library to log 'interesting' things that happen. In other words, the idea is if the user of the library is interested in the details that happen in the package internally, he (she?) would configure a logging level and handlers that write the log messages

  1   2   3   >