Re: Decimal vs Float comparasion

2008-05-05 Thread Wojciech Walczak
2008/5/6, Wojciech Walczak <[EMAIL PROTECTED]>: > a > 9.0 returns True because NotImplemented > 9.0 returns True. > a < 9.0 returns False because NotImplemented < 9.0 returns False. Sorry, it should rather be: Decimal('0.5') > 9.0 returns True because: Decimal('0.5') > NotImplem

Re: config files in python

2008-05-05 Thread Jorge Vargas
On Tue, May 6, 2008 at 2:00 AM, sandipm <[EMAIL PROTECTED]> wrote: > > here I would like to have python file which read conf from text file > and load those params in current process space. > so only importing that python file should read up the conf file and > load the current process with co

Re: How can we write a class factory that dynamically redefines the __init__ function etc.

2008-05-05 Thread s0suk3
On May 6, 12:14 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > (the convention is to use lowercase names for attributes: rawdata instead > of RawData) > But at least put an underscore between the words (raw_data), or, if you like the OO world, make the subsequent words capitalized (rawData).

Re: Decimal vs Float comparasion

2008-05-05 Thread Wojciech Walczak
2008/5/6, Yuan HOng <[EMAIL PROTECTED]>: > It seems decimal object will always be larger than float in > comparasion, which goes against common sense: > > >>> from decimal import Decimal > >>> a = Decimal('0.5') > >>> a > 9 > False > >>> a > 9.0 > True > > It seems to me that rathe

Re: USB HID documentation?

2008-05-05 Thread Tim Roberts
"Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > >You seem to misunderstand HID. HID is a protocol over USB (and Bluetooth I >believe) that will create user input device events which are mapped to your >OS input layer. That means that whenever you e.g. attach a keyboard device, >it's keyboard events

Re: word shifts

2008-05-05 Thread Arnaud Delobelle
George Sakkis <[EMAIL PROTECTED]> writes: > On May 5, 11:02 pm, dave <[EMAIL PROTECTED]> wrote: >> On 2008-05-04 01:10:40 -0600, Arnaud Delobelle <[EMAIL PROTECTED]> said: >> >> >> >> > dave <[EMAIL PROTECTED]> writes: >> >> >> Hello, >> >> >> I made a function that takes a word list (one word per

Re: config files in python

2008-05-05 Thread sandipm
Thanks for various useful suggestions. actually right now I am using conf files only in psp handler of mod_python/apache but I have other processes which might use same config files. One way is I can put conf related data directly in database and database handling module can directly pickup values

Re: How to pass a multiline arg to exec('some.exe arg')?

2008-05-05 Thread n00m
> Yes, call flush() each time you're done writing. No, it would be too easy & simple. While stdin is NOT CLOSED stdout has not EOF, but readlines() waits for its appearence ... and so freezes for good. IMO. Should be like this: import popen2 o=popen2.popen2('osql -E -S(local) -dpubs -c"GO" -n -w

Re: #!/usr/bin/env python vs. #!/usr/bin/python

2008-05-05 Thread andrej . panjkov
At our site we run IRIX, UNICOS, Solaris, Tru64, Linux, cygwin and other unixy OSes. We have python installed in a number of different places: /bin/python /usr/local/bin/python /usr/bin/python /opt/freeware/Python/Python-2.5.1/bin/python ~mataap/platform/python/python-2.5.1 So I cannot assume a

Re: Feature suggestion: sum() ought to use a compensated summation algorithm

2008-05-05 Thread Gabriel Genellina
En Mon, 05 May 2008 05:08:15 -0300, Raymond Hettinger <[EMAIL PROTECTED]> escribió: On May 3, 9:50 am, Szabolcs Horvát <[EMAIL PROTECTED]> wrote: I did the following calculation:  Generated a list of a million random numbers between 0 and 1, constructed a new list by subtracting the mean valu

Re: How can we write a class factory that dynamically redefines the __init__ function etc.

2008-05-05 Thread Gabriel Genellina
En Mon, 05 May 2008 20:34:32 -0300, John Schroeder <[EMAIL PROTECTED]> escribió: Basically I have some classes like this: ### # 0x01: ModeCommand ##

Bad form to access a *private variable* like _foo?

2008-05-05 Thread [EMAIL PROTECTED]
Bad form to access a *private variable* like _foo? The reason I'm asking is that TurboGears/SQLObject mobel objects have an attribute called "_connection" that must be used to manually commit database stuff e.g. MyObject._connection.commit() It bugs me. I don't know if it is a stylistic fa

Re: How to generate binary python?

2008-05-05 Thread Gabriel Genellina
En Mon, 05 May 2008 19:43:24 -0300, David Anderson <[EMAIL PROTECTED]> escribió: Hi, i'm comingo from Java and I'm wanting to know what in Python is the equivalent to the file.class in java, I am producing some apps that ar not open source, so I would like to share only the binaries, Both f

Re: threading: getting latest elements from list/dict

2008-05-05 Thread Gabriel Genellina
En Mon, 05 May 2008 08:26:45 -0300, Vaibhav.bhawsar <[EMAIL PROTECTED]> escribió: Hello I have a thread updating a dictionary with new elements. How can I check for new elements as they are inserted into the dictionary by the thread? In general is it safe to read a dictionary or a list whil

Re: SSL through python. possible ?

2008-05-05 Thread Heikki Toivonen
TkNeo wrote: > ok i have tried around a lot but no luck. I think M2Crypto is my best > option except it requires a minimum of python 2.4 which i don't have. M2Crypto requires Python 2.3. There are optional features that require newer Python. If you run into anything else (=bugs) that does not work

Re: Decimal vs Float comparasion

2008-05-05 Thread Gasto
I still don't see why such a module exists. On 5 mayo, 21:52, "Yuan HOng" <[EMAIL PROTECTED]> wrote: > Hi, > > It seems decimal object will always be larger than float in > comparasion, which goes against common sense: > > >>> from decimal import Decimal > >>> a = Decimal('0.5') > >>> a > 9 >

Decimal vs Float comparasion

2008-05-05 Thread Yuan HOng
Hi, It seems decimal object will always be larger than float in comparasion, which goes against common sense: >>> from decimal import Decimal >>> a = Decimal('0.5') >>> a > 9 False >>> a > 9.0 True It seems to me that rather than allowing this to happen, comparasion between the two shoul

Re: Feature suggestion: sum() ought to use a compensated summation algorithm

2008-05-05 Thread Gabriel Genellina
En Mon, 05 May 2008 11:08:02 -0300, Szabolcs <[EMAIL PROTECTED]> escribió: On May 5, 12:24 pm, Duncan Booth <[EMAIL PROTECTED]> wrote: Szabolcs <[EMAIL PROTECTED]> wrote: > On May 5, 9:37 am, Szabolcs Horvát <[EMAIL PROTECTED]> wrote: >> Gabriel Genellina wrote: >> > Python doesn't require __a

Re: generator functions in another language

2008-05-05 Thread castironpi
On May 5, 1:55 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On May 4, 1:11 pm, [EMAIL PROTECTED] wrote: > > > There is no such thing as a 'frame' per se in C; byte code is > > integral.  As there is no such thing as suspended state without > > frames, and no such thing as generators without

Re: word shifts

2008-05-05 Thread George Sakkis
On May 5, 11:02 pm, dave <[EMAIL PROTECTED]> wrote: > On 2008-05-04 01:10:40 -0600, Arnaud Delobelle <[EMAIL PROTECTED]> said: > > > > > dave <[EMAIL PROTECTED]> writes: > > >> Hello, > > >> I made a function that takes a word list (one word per line, text > >> file) and searches for all the words

Re: STL multimap

2008-05-05 Thread castironpi
On May 5, 6:40 pm, [EMAIL PROTECTED] wrote: > On May 5, 1:26 pm, Aaron Watters <[EMAIL PROTECTED]> wrote: > > > > > > > Hi there.  Maybe a little more context would > > help us figure out what you want here... > > > On May 5, 1:28 pm, [EMAIL PROTECTED] wrote: > > > > Is multimap just a syntax-check

Re: config files in python

2008-05-05 Thread George Sakkis
On May 5, 6:57 pm, Matimus <[EMAIL PROTECTED]> wrote: > On May 5, 10:22 am, Francesco Bochicchio <[EMAIL PROTECTED]> wrote: > > > > > On Mon, 05 May 2008 00:35:51 -0700, sandipm wrote: > > > Hi, > > > In my application, I have some configurable information which is used > > > by different processe

Re: word shifts

2008-05-05 Thread dave
On 2008-05-04 01:10:40 -0600, Arnaud Delobelle <[EMAIL PROTECTED]> said: dave <[EMAIL PROTECTED]> writes: Hello, I made a function that takes a word list (one word per line, text file) and searches for all the words in the list that are 'shifts' of eachother. 'abc' shifted 1 is 'bcd' Please

notification of file truncate

2008-05-05 Thread nishant . deshpande
hi, I am running ubuntu 7.1 (linux 2.6.22-12-generic) i was trying to implement 'tail -f' (well tail -F actually but for this example i think its not relevent) and one of the features which i couldn't get in python was notification of truncation of a file. i looked at the inotify (the pyinotify

Python-URL! - weekly Python news and links (May 6)

2008-05-05 Thread Gabriel Genellina
QOTW: "[buildout] is not just some stupid thing." - Alan Runyan http://wiki.python.org/moin/buildout has more background sum() doesn't use the best possible algorithm when dealing with floating point numbers: http://mail.python.org/pipermail/python-list/2008-May/4

Re: listing computer hard drives with python

2008-05-05 Thread python newbie
Sorry, I forgot to copy the list. Looks like you are doing this on Windows. Windows has a built in command call fsutil that would work in this situation. The syntax would be: C:\Documents and Settings\username>fsutil fsinfo drives Drives: C:\ D:\ E:\ To find out the type of drive you can use

Re: Nested os.path.join()'s

2008-05-05 Thread Scott David Daniels
Paul Scott wrote: ... example: if os.path.exists(os.path.join(basedir,picdir)) == True : blah blah Question is, is there a better way of doing this? The above *works* but it looks kinda hackish... You've had the joining addressed elsewhere, but note that: if os.path.exists(os.path.join

Python Programmer position available in New York

2008-05-05 Thread Rakhi
Title: Python Programmer Location: Orangeburg, NY 10962 6 months position Roles and responsibilities:- · Designs and codes from specifications, analyzes, evaluates, tests, debugs, documents, and implements moderately complex software applications. Prepares detailed specifications. ·

Re: STL multimap

2008-05-05 Thread castironpi
On May 5, 1:26 pm, Aaron Watters <[EMAIL PROTECTED]> wrote: > Hi there.  Maybe a little more context would > help us figure out what you want here... > > On May 5, 1:28 pm, [EMAIL PROTECTED] wrote: > > > Is multimap just a syntax-checked dictionary of mutable sequences? > > I think the equivalent o

How can we write a class factory that dynamically redefines the __init__ function etc.

2008-05-05 Thread John Schroeder
Basically I have some classes like this: ### # 0x01: ModeCommand ### class ModeCommand: """This is the Mode Command Packet class.""" def

Re: config files in python

2008-05-05 Thread Matimus
On May 4, 11:35 pm, sandipm <[EMAIL PROTECTED]> wrote: > Hi, > In my application, I have some configurable information which is used > by different processes. currently I have stored configration in a > conf.py file as name=value pairs, and I am importing conf.py file to > use this variable. it wo

Re: config files in python

2008-05-05 Thread Matimus
On May 5, 10:22 am, Francesco Bochicchio <[EMAIL PROTECTED]> wrote: > On Mon, 05 May 2008 00:35:51 -0700, sandipm wrote: > > Hi, > > In my application, I have some configurable information which is used > > by different processes. currently I have stored configration in a > > conf.py file as name=

Re: ]ANN[ Vellum 0.16: Lots Of Documentation and Watching

2008-05-05 Thread Paul Boddie
On 5 Mai, 23:57, [EMAIL PROTECTED] (Ville M. Vainio) wrote: > Paul Boddie <[EMAIL PROTECTED]> writes: > > Anyway, I'm just confirming that I'm clearly not one of the "many" > > described above. A lot of my own work is licensed under the GPL or > > I guess it's safe to assume that you are not oppose

Re: logger output

2008-05-05 Thread Gabriel Genellina
En Mon, 05 May 2008 13:02:12 -0300, skunkwerk <[EMAIL PROTECTED]> escribió: > On May 4, 10:40 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: >> En Mon, 05 May 2008 00:33:12 -0300,skunkwerk<[EMAIL PROTECTED]> escribió: >> >> > i'm redirecting the stdout & stderr of my python program to a log.

How to generate binary python?

2008-05-05 Thread David Anderson
Hi, i'm comingo from Java and I'm wanting to know what in Python is the equivalent to the file.class in java, I am producing some apps that ar not open source, so I would like to share only the binaries, Both for Windows and for Linux, Can you suggest me anything? Bye -- http://mail.python.org/mail

Re: SSL through python. possible ?

2008-05-05 Thread TkNeo
On May 5, 2:32 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Mon, 5 May 2008 11:11:19 -0700 (PDT),TkNeo<[EMAIL PROTECTED]> wrote: > >On May 2, 1:52 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote: > >> On May 2, 1:20 pm, Heikki Toivonen <[EMAIL PROTECTED]> wrote: > > >> > Mike Driscoll wrote:

Re: Browser + local Python-based web server vs. wxPython

2008-05-05 Thread Stef Mientki
Mike Driscoll wrote: On May 5, 9:22 am, [EMAIL PROTECTED] wrote: I'm looking at rewriting some legacy VB applications and am pondering which of the following techniques to use: 1. Browser based GUI with local web server (Browser + wsgiref.simple_server) (I'm assuming that simple_server is cl

Re: get the pid of a process with pexpect

2008-05-05 Thread Noah
On May 5, 7:18 am, Karim Bernardet <[EMAIL PROTECTED]> wrote: > ssh_tunnel = pexpect.spawn (tunnel_command % globals()) > ... > print ssh_tunnel.pid > > but ssh_tunnel is not the pid of the ssh tunnel > > Is there a way to get it using pexpect ? You will notice that you can't get this information

License selection for free software (was: ]ANN[ Vellum 0.16: Lots Of Documentation and Watching)

2008-05-05 Thread Ben Finney
[EMAIL PROTECTED] (Ville M. Vainio) writes: > Paul Boddie <[EMAIL PROTECTED]> writes: > > > Anyway, I'm just confirming that I'm clearly not one of the "many" > > described above. A lot of my own work is licensed under the GPL or > > I guess it's safe to assume that you are not opposed to using

Re: ]ANN[ Vellum 0.16: Lots Of Documentation and Watching

2008-05-05 Thread Ville M. Vainio
Paul Boddie <[EMAIL PROTECTED]> writes: > Anyway, I'm just confirming that I'm clearly not one of the "many" > described above. A lot of my own work is licensed under the GPL or I guess it's safe to assume that you are not opposed to using code based on more liberal license, right? :-) My point

Re: ]ANN[ Vellum 0.16: Lots Of Documentation and Watching

2008-05-05 Thread Paul Boddie
On 5 Mai, 20:26, [EMAIL PROTECTED] (Ville M. Vainio) wrote: > > Basically, avoiding GPL maximizes the brainshare that a small-ish tool > is going to attract, and many (including myself, FWIW) view GPL as a > big turn-off when I consider spending some time to familiarize myself > with a tool, or rec

Re: Random/anonymous class methods

2008-05-05 Thread philly_bob
On Apr 27, 8:05 am, philly_bob <[EMAIL PROTECTED]> wrote: > In the sample program below, I want to send a random method to a class > instance. > In other words, I don't know which method to send until run-time. How > can I send ch, which is my random choice, to the myclass instance? > > Thanks, >

Re: Browser + local Python-based web server vs. wxPython

2008-05-05 Thread Mike Driscoll
On May 5, 9:22 am, [EMAIL PROTECTED] wrote: > I'm looking at rewriting some legacy VB applications and am pondering > which of the following techniques to use: > > 1. Browser based GUI with local web server (Browser + > wsgiref.simple_server) (I'm assuming that simple_server is class I want > to bu

Re: SSL through python. possible ?

2008-05-05 Thread Todd Whiteman
TkNeo wrote: ok i have tried around a lot but no luck. I think M2Crypto is my best option except it requires a minimum of python 2.4 which i don't have. What i am trying to do is to do an FTP transfer that uses SSL (username, password authentication) and not a certificate file. The few example i

Re: Visual Studio 6 compile of 2.5.2 fails with missing db.h

2008-05-05 Thread brucoder
On May 5, 1:46 pm, Christian Heimes <[EMAIL PROTECTED]> wrote: > brucoder schrieb: > > > Any pointers?  A prerequisite that I might be missing?  The source is > > the Python-2.5.2.tar.gz from the Python.org site. > > The tar.gz doesn't contain the dependencies like the bsddb files or > sqlite3, bzi

Re: Colors for Rows

2008-05-05 Thread [EMAIL PROTECTED]
> On Tue, 29 Apr 2008 09:33:32 -0500 > "Victor Subervi" <[EMAIL PROTECTED]> wrote: > print '' % bg You'd better learn to use css instead. -- http://mail.python.org/mailman/listinfo/python-list

Re: Browser + local Python-based web server vs. wxPython

2008-05-05 Thread [EMAIL PROTECTED]
On 5 mai, 16:22, [EMAIL PROTECTED] wrote: > I'm looking at rewriting some legacy VB applications and am pondering > which of the following techniques to use: > > 1. Browser based GUI with local web server (Browser + > wsgiref.simple_server) (I'm assuming that simple_server is class I want > to buil

Re: psycopg2 ReferenceManual

2008-05-05 Thread Daniel Fetchinson
> Hi all, where can I find the reference manual from the psycopg2 or the > dbapi2.0 because in their official pages I could'nt find > thx > > Once you have the source of any package you can create a reference manual using e.g. epydoc. -- http://mail.python.org/mailman/listinfo/python-list

Re: [Twisted-Python] Counting errors in a DeferredList and avoiding Unhandled error in Deferred messages

2008-05-05 Thread Terry Jones
Hi Jean-Paul > You can do this (if you replace `pass´ with `None´, anyway) or you can pass > `consumeErrors=True´ to the `DeferredList´ initializer which will make it > do something equivalent. Thanks. Sorry - I should have just read the docs again :-) Terry -- http://mail.python.org/mailman/lis

Python Minidom Help

2008-05-05 Thread Alok Kumar
Hi, I am reading a XML data from HTTP server and giving it to parse method. dom = parse(dataread) It throws following error File "/usr/lib/python2.3/site-packages/_xmlplus/dom/minidom.py", line 1908, in parse return expatbuilder.parse(file) File "/usr/lib/python2.3/site-packages/_xmlpl

Re: Visual Studio 6 compile of 2.5.2 fails with missing db.h

2008-05-05 Thread Christian Heimes
brucoder schrieb: > Any pointers? A prerequisite that I might be missing? The source is > the Python-2.5.2.tar.gz from the Python.org site. The tar.gz doesn't contain the dependencies like the bsddb files or sqlite3, bzip2 and more. You have to download and unpack the correct versions into the c

Re: SSL through python. possible ?

2008-05-05 Thread Jean-Paul Calderone
On Mon, 5 May 2008 11:11:19 -0700 (PDT), TkNeo <[EMAIL PROTECTED]> wrote: On May 2, 1:52 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote: On May 2, 1:20 pm, Heikki Toivonen <[EMAIL PROTECTED]> wrote: > Mike Driscoll wrote: > > On Apr 29, 8:56 am,TkNeo<[EMAIL PROTECTED]> wrote: > >> I need to do SSL

Re: pygame music, cant read mp3?

2008-05-05 Thread globalrev
On 5 Maj, 17:25, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > directory = ['C:','Python25','myPrograms','pygameProgs','dront.mp3'] > > os.path.join(directory) > > > Then python can worry about the gritty details, and you don't have to. > > Or somewhat neater IMHO: > > os.path.join('C:','Python

Re: Are rank noobs tolerated, here?

2008-05-05 Thread Mensanator
On May 5, 1:43 pm, notbob <[EMAIL PROTECTED]> wrote: > On 2008-05-04, notbob <[EMAIL PROTECTED]> wrote: > > > I'm trying to learn how to program.  I'm using: > > > How to Think Like a Computer Scientist > > > Learning with Python > > 2nd Edition > > http://openbookproject.net//thinkCSpy/index.xhtml

Re: USB HID documentation?

2008-05-05 Thread ETP
I don't doubt I misunderstand since most programming jargon goes over my head. That said, I'm sure you can guess my OS is Windows and I don't know what an API is. After a quick search it looks like windows uses something called DirectInput for gaming devices. Is anyone familiar with DirectInput?

Re: confused about self, why not a reserved word?

2008-05-05 Thread Terry Reedy
"globalrev" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | sorry i noticed now a little error, i was playing around a lot and saw | that on the sel-example i had then called foo.hello() instead of | foo.Hello(). Lesson: whenever one inquires about an 'error', one should cut and pa

Re: generator functions in another language

2008-05-05 Thread [EMAIL PROTECTED]
On May 4, 1:11 pm, [EMAIL PROTECTED] wrote: > There is no such thing as a 'frame' per se in C; byte code is > integral. As there is no such thing as suspended state without > frames, and no such thing as generators without suspended state. Well, for implementing generators there are alternatives

Re: Are rank noobs tolerated, here?

2008-05-05 Thread notbob
On 2008-05-04, notbob <[EMAIL PROTECTED]> wrote: > I'm trying to learn how to program. I'm using: > > How to Think Like a Computer Scientist > > Learning with Python > 2nd Edition http://openbookproject.net//thinkCSpy/index.xhtml OK then, using the above, I get everything up till chap 3 and

Re: ISBN Barecode reader in Python?

2008-05-05 Thread Ville M. Vainio
Max Erickson <[EMAIL PROTECTED]> writes: > The killer application for ISBN lookup on Amazon is checking prices > while in the bookstore. Being able to email a photo from your phone > and then getting an email with the Amazon price in response would be > way easier than typing the isbn into Goo

Re: Visual Studio 6 compile of 2.5.2 fails with missing db.h

2008-05-05 Thread brucoder
On May 5, 11:43 am, brucoder <[EMAIL PROTECTED]> wrote: > Hi Folks, > > Searched the archives, but I can only find mention of db.h problems relating > to Linux. > > I've downloaded the source for 2.5.2 and am trying to compile it in Visual > Studio 6 (SP6). I've just stepped back to 2.3.7 and re

Re: [ANN] Vellum 0.16: Lots Of Documentation and Watching

2008-05-05 Thread Ville M. Vainio
[EMAIL PROTECTED] writes: > I didn't find your language offensive but you might consider toning down > your review of the Awesome Window Manager :) Nah - keep up the bad attitude. Your (Zed) blog/articles are one of the few things on the programmosphere that actually make me laugh audibly. -- ht

Re: ISBN Barecode reader in Python?

2008-05-05 Thread Max Erickson
Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > Joseph <[EMAIL PROTECTED]> wrote: >> All: I have written a program to query Amazon with ISBN and get >> the book details. I would like to extend so that I can read >> ISBN from the barcode (I will take a photo of the same using >> webcam or mobile).

Re: Preventing 'bad' filenames from raising errors in os.path

2008-05-05 Thread python
Matimus and John, Thank you both for your feedback. Matimus: I agree with your analysis. I blame lack of caffeine for my original post :) Regards, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Writing elapsed time as a string

2008-05-05 Thread Simon Pickles
Hello. I'm sorry if this has been asked a thousand (million) times. Is there a nifty pythonesque way to produce a string representing an elapsed time period, in terms of years, months, days, hours, mins, seconds? I am storing times in a MySQL db, and would love to be able to write the time e

Writing elapsed time as a string

2008-05-05 Thread Simon Pickles
Hello. I'm sorry if this has been asked a thousand (million) times. Is there a nifty pythonesque way to produce a string representing an elapsed time period, in terms of years, months, days, hours, mins, seconds? I am storing times in a MySQL db, and would love to be able to write the time e

Re: Best way to store config or preferences in a multi-platform way

2008-05-05 Thread python
Lance, > I am still undecided if the ability for the user to edit the file > independently of the program is a good or bad thing. I prefer user viewable plain (non-XML) text files because: - easy to make a change in case of emergency - easy to visually review and search - easy to version contro

os.open and O_EXCL

2008-05-05 Thread Ethan Furman
Greetings! I am trying to lock a file so no other process can get read nor write access to it. I thought this was possible with os.open(filename, os.O_EXCL), but that is not working. I am aware of the win32file option to do file locking, so my question is this: what is the purpose of the o

Re: STL multimap

2008-05-05 Thread Aaron Watters
Hi there. Maybe a little more context would help us figure out what you want here... On May 5, 1:28 pm, [EMAIL PROTECTED] wrote: > Is multimap just a syntax-checked dictionary of mutable sequences? I think the equivalent of a multimap can be implemented several different ways, depending on what

Re: Best way to store config or preferences in a multi-platform way.

2008-05-05 Thread python
Lance, > I am still undecided if the ability for the user to edit the file > independently of the program is a good or bad thing. I prefer user viewable plain (non-XML) text files because: - easy to make a change in case of emergency - easy to visually review and search - easy to version contro

listing computer hard drives with python

2008-05-05 Thread Ohad Frand
Hi I am looking for a way to get a list of all active logical hard drives of the computer (["c:","d:"..]) Thanks, Ohad -- http://mail.python.org/mailman/listinfo/python-list

psycopg2 ReferenceManual

2008-05-05 Thread David Anderson
Hi all, where can I find the reference manual from the psycopg2 or the dbapi2.0 because in their official pages I could'nt find thx -- http://mail.python.org/mailman/listinfo/python-list

need help of regular expression genius

2008-05-05 Thread RJ vd Oest
-- http://mail.python.org/mailman/listinfo/python-list

Re: How do I say "Is this a function"?

2008-05-05 Thread Fabiano Sidler
John Henry schrieb: exec fct You don't want this. You want to store the function in a list instead: l = [ f1, f3, others ] for i in [0,1]: l[i]() Greetings, Fabiano -- http://mail.python.org/mailman/listinfo/python-list

Re: So you think PythonCard is old? Here's new wine in an old bottle.

2008-05-05 Thread Daniel Fetchinson
> > For serveral years, I have been looking for a way to migrate away from > desktop GUI/client-server programming onto the browser based network > computing model of programming. Unfortunately, up until recently, > browser based programs are very limited - due to the limitation of > HTML itself.

Re: ]ANN[ Vellum 0.16: Lots Of Documentation and Watching

2008-05-05 Thread Ville M. Vainio
"Zed A. Shaw" <[EMAIL PROTECTED]> writes: > GPLv3? > > How do people feel about Vellum's GPLv3 status? It actually doesn't > impact anyone unless you embed Vellum into a project/product or you Yeah, but it effectively prevents people from embedding it into their apps that wish to remain BSD/MIT

Re: SSL through python. possible ?

2008-05-05 Thread TkNeo
On May 2, 1:52 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote: > On May 2, 1:20 pm, Heikki Toivonen <[EMAIL PROTECTED]> wrote: > > > Mike Driscoll wrote: > > > On Apr 29, 8:56 am,TkNeo<[EMAIL PROTECTED]> wrote: > > >> I need to do SSL file transfer using python? Is there a library i can > > >> use ? >

Re: So you think PythonCard is old? Here's new wine in an old bottle.

2008-05-05 Thread jbarciela
John, you are the man > during my search for perfection, I found Qooxdoo (http://qooxdoo.org/). > > ... > > I found QxTransformer > (http://sites.google.com/a/qxtransformer.org/qxtransformer/Home) which is a > XSLT toolkit that creats XML code that invoke qooxdoo. Qooxdoo is indeed really impres

Re: unicode newbie - printing mixed languages to the terminal

2008-05-05 Thread David
> I suggest you read http://www.amk.ca/python/howto/unicode to demystify what > Unicode is and does, and how to use it in Python. That document really helped. This page helped me to setup the console:http://www.jw-stumpel.nl/stestu.html#T3 I ran: dpkg-reconfigure locales # And enabled a en_ZA.

cgitb performance issue

2008-05-05 Thread Ethan Furman
Greetings! I tried adding a form to our website for uploading large files. Personally, I dislike the forms that tell you you did something wrong and make you re-enter *all* your data again, so this one cycles and remembers your answers, and only prompts for the file once the rest of the ente

Re: generator functions in another language

2008-05-05 Thread J. Cliff Dyer
On Mon, 2008-05-05 at 10:08 -0700, [EMAIL PROTECTED] wrote: > At some point, code goes "on" and "off" the processor, which knowledge > I do owe to spending money. Thus, if the group news is a localcy > (other dimension of currency), that's bounce check the house dollar. > What do [second person pl

Visual Studio 6 compile of 2.5.2 fails with missing db.h

2008-05-05 Thread brucoder
Hi Folks, Searched the archives, but I can only find mention of db.h problems relating to Linux. I've downloaded the source for 2.5.2 and am trying to compile it in Visual Studio 6 (SP6). The error reports read: Configuration: _bsddb - Win32 Debug Compili

Re: [Twisted-Python] Counting errors in a DeferredList and avoiding Unhandled error in Deferred messages

2008-05-05 Thread Jean-Paul Calderone
On Mon, 5 May 2008 19:10:39 +0200, Terry Jones <[EMAIL PROTECTED]> wrote: If I pass a list of deferreds to DeferredList and want to add a callback to the DeferredList to look at whatever errors have occurred in the underlying deferreds, should I do something like this: deferreds = [] for x in

Re: How to pass a multiline arg to exec('some.exe arg')?

2008-05-05 Thread Ian Kelly
> btw, is it necessarily to close() osql[1] in order to get res? > without close() the script seems is waiting for smth. > I'd like to get "res" in a loop: > write() > read() > write() > read() > ... > is it possible? Yes, call flush() each time you're done writing. -- http://mail.python.

Re: Script using generators produces different results when invoked as a CGI

2008-05-05 Thread Nick Craig-Wood
Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Mon, 05 May 2008 00:31:45 -0300, Barclay, Ken <[EMAIL PROTECTED]> > escribió: > > > I attended David Beazley's awe-inspiring tutorial on the use of > > generators in systems programming: > >http://www.dabeaz.com/generators/ > > http://www.dabeaz.

Re: get the pid of a process with pexpect

2008-05-05 Thread Nick Craig-Wood
Karim Bernardet <[EMAIL PROTECTED]> wrote: > Hi > > I am using pexpect to do ssh tunneling and to open a vnc server (jobs on > a grid cluster). When the job is canceled, these 2 processes remain on > the worker node (they are detached), so I have to kill them (using a > trap command in the

STL multimap

2008-05-05 Thread castironpi
Is multimap just a syntax-checked dictionary of mutable sequences? Is def( a ): a[:]= [x] a trick or part of the language? It looks pretty sharp in variable-width. -- http://mail.python.org/mailman/listinfo/python-list

Re: Feature suggestion: sum() ought to use a compensated summation algorithm

2008-05-05 Thread Robert Kern
Gabriel Genellina wrote: Python doesn't require __add__ to be associative, so this should not be used as a general sum replacement. But if you know that you're adding floating point numbers you can use whatever algorithm best fits you. Or use numpy arrays; I think they implement Kahan summatio

Re: config files in python

2008-05-05 Thread Francesco Bochicchio
On Mon, 05 May 2008 00:35:51 -0700, sandipm wrote: > Hi, > In my application, I have some configurable information which is used > by different processes. currently I have stored configration in a > conf.py file as name=value pairs, and I am importing conf.py file to > use this variable. it works

Re: generator functions in another language

2008-05-05 Thread castironpi
On May 5, 12:28 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Mon, 05 May 2008 00:09:02 -0300, hdante <[EMAIL PROTECTED]> escribió: > > > > > > >  Isn't this guy a bot ? :-) It's learning fast. I believe there is a > > "frame" in C, composed of its stack and globals. For generators in C,

Re: Feature suggestion: sum() ought to use a compensated summation algorithm

2008-05-05 Thread Rhamphoryncus
On May 3, 4:31 pm, Thomas Dybdahl Ahle <[EMAIL PROTECTED]> wrote: > On Sat, 2008-05-03 at 21:37 +, Ivan Illarionov wrote: > > On Sat, 03 May 2008 20:44:19 +0200, Szabolcs Horvát wrote: > > > > Arnaud Delobelle wrote: > > > >> sum() works for any sequence of objects with an __add__ method, not >

Re: Python application distribution

2008-05-05 Thread Ville M. Vainio
ron.longo wrote: > unable to execute. Why is this? At this point I'm not really keen on > handing out the source files to my application, it feels unprofessional. If you plan to deploy on windows, py2exe could be the more "professional" approach you are thinking of. -- http://mail.python.org

Re: Python application distribution

2008-05-05 Thread Ville M. Vainio
ron.longo wrote: unable to execute. Why is this? At this point I'm not really keen on handing out the source files to my application, it feels unprofessional. If you plan to deploy on windows, py2exe could be the more "professional" approach you are thinking of. -- http://mail.python.org/m

Re: How to convert unicode string to unsigned char *

2008-05-05 Thread Martin v. Löwis
> some_module.some_thing(the_string) function is a swig generated > function from a C lib. The C lib function expects unsigned char *. > > The generated function is: If you don't want to change the generated function, I recommend to put a wrapper around it, as Jean-Paul suggested: def some_thing

Re: logger output

2008-05-05 Thread skunkwerk
On May 4, 10:40 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Mon, 05 May 2008 00:33:12 -0300,skunkwerk<[EMAIL PROTECTED]> escribió: > > > > > i'm redirecting the stdout & stderr of my python program to a log. > > Tests i've done on a simple program with print statements, etc. work > > fi

Re: pygame music, cant read mp3?

2008-05-05 Thread Diez B. Roggisch
> directory = ['C:','Python25','myPrograms','pygameProgs','dront.mp3'] > os.path.join(directory) > > Then python can worry about the gritty details, and you don't have to. Or somewhat neater IMHO: os.path.join('C:','Python25','myPrograms','pygameProgs','dront.mp3') Diez -- http://mail.python.

Re: pygame music, cant read mp3?

2008-05-05 Thread J. Cliff Dyer
On Mon, 2008-05-05 at 07:32 -0700, globalrev wrote: > On 5 Maj, 16:29, globalrev <[EMAIL PROTECTED]> wrote: > > On 5 Maj, 16:09, globalrev <[EMAIL PROTECTED]> wrote: > > > > > > > > > On 5 Maj, 14:17, "Wojciech Walczak" <[EMAIL PROTECTED]> > > > wrote: > > > > > > 2008/5/5, globalrev <[EMAIL PROTEC

Interested to code leecher mods in python?

2008-05-05 Thread WorldWide
Hi. Is here anyone interested to help us code some bittorrent leecher mods? We need a bit help with the gui in the mods. You just need to have python knowledge. We have our own [quite successful] forums and a great team. Please email me: [EMAIL PROTECTED] best regards -- http://mail.python.org/ma

Re: How to pass a multiline arg to exec('some.exe arg')?

2008-05-05 Thread n00m
it can be done like this: osql=popen2.popen2('osql -E -S(local) -dpubs -c"GO" -n - w800') osql[1].write(query+'\nGO\n') osql[1].close() res=osql[0].readlines() osql[0].close() res=join(res,'') btw, is it necessarily to close(

Re: Pygame and PGU

2008-05-05 Thread Zaka
On 5 Maj, 16:45, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Zaka wrote: > > Hi. I need some help to make map system in PGU. For exmple we have 2 > > maps and when we leave first we enter to second. > > > > >! > > > ___ > > What is a PGU? What is

Re: Pygame and PGU

2008-05-05 Thread Diez B. Roggisch
Zaka wrote: > Hi. I need some help to make map system in PGU. For exmple we have 2 > maps and when we leave first we enter to second. > > > >! > > > ___ What is a PGU? What is a map-system? And what is that ascii art above? And what might you

  1   2   >