Re: Need help to pass self.count to other classes.

2010-01-08 Thread Lie Ryan
On 1/8/2010 3:56 PM, Steven D'Aprano wrote: Unfortunately this won't do what you expect, because sys.ps1 and ps2 should be either strings, or objects with a __str__ method. They aren't called to generate the prompt. but their __str__ does get called to generate the prompt. import sys class kb

Re: C Structure rebuild with ctypes

2010-01-08 Thread Mark Tolonen
"Georg" wrote in message news:7qo9avfiv...@mid.individual.net... Hi Mark, Are you passing in these values, or are they being returned? To me the depth of the pointer references implies numVars, varNames, and varTypes are out parameters. I'll assume that for now. If they are in/out parame

Re: Manipulating pointers in C using ctypes

2010-01-08 Thread Mark Tolonen
"Daniel Platz" wrote in message news:08bda34e-9bee-44b1-b2de-80d647151...@a15g2000yqm.googlegroups.com... Hello! I have to ask a newbie question about manipulating pointers in C using ctypes. I have a C dll with two functions. The first one creates a pointer and returns it to python. The seco

Re: Caching objects in a C extension

2010-01-08 Thread casevh
On Jan 8, 8:56 am, Antoine Pitrou wrote: > Le Fri, 08 Jan 2010 08:39:17 -0800, casevh a écrit : > > > > > Thanks for the reply. I realized that I missed one detail. The objects > > are created by the extension but are deleted by Python. I don't know > > that an object is no longer needed until its

Re: Python multiprocessing: Permission denied

2010-01-08 Thread t0ster
On Jan 6, 1:20 am, Steven D'Aprano wrote: > On Tue, 05 Jan 2010 13:52:18 -0800,t0sterwrote: > > It looks like the user don't have permission to access shared memory. > > When executing with root privileges it works fine. > > > Is there any solution to run it as normal user(not root)? > > Then give

Re: PIL how to display multiple images side by side

2010-01-08 Thread Sean DiZazzo
On Jan 8, 1:43 pm, "suresh.amritapuri" wrote: > Hi, > > In PIL, how to display multiple images in say m rows and n colums when > I have m*n images. > > suresh Sounds like a good project to learn PIL with. ~Sean -- http://mail.python.org/mailman/listinfo/python-list

Re: restructuredText editor ?

2010-01-08 Thread Florian Diesch
Peter writes: > What editor do people out there use to edit .rst files for > sphinx-python documentation ? Emacs with ReST mode and YASnippet Florian -- -- http://mail.python.org/mailman/listinfo/python-list

Re: Scripting (was Re: Python books, literature etc)

2010-01-08 Thread Florian Diesch
Jorgen Grahn writes: > Regarding the book's title: is it just me, or are Python programmers > in general put off when people call it "scripting"? > > I won't attempt a strict definition of the term "scripting language", > but it seems like non-programmers use it to mean "less scary than what > yo

Re: lightweight encryption of text file

2010-01-08 Thread Steven D'Aprano
On Fri, 08 Jan 2010 20:14:51 +0100, Daniel Fetchinson wrote: > I have a plain text file which I would like to protect in a very simple > minded, yet for my purposes sufficient, way. I'd like to encrypt/convert > it into a binary file in such a way that possession of a password allows > anyone to c

Re: One function calling another defined in the same file being exec'd

2010-01-08 Thread Terry Reedy
On 1/8/2010 12:02 PM, Mitchell L Model wrote: On further reflection, I will add that what appears to be happening is that during import both the global and local dictionaries are set to a copy of the globals() from the importing scope and that copy becomes the value of the module's __dict__ onc

Re: Standardized interpreter speed evaluation tool

2010-01-08 Thread Chris Rebert
On Fri, Jan 8, 2010 at 2:25 AM, alexru wrote: > Is there any standardized interpreter speed evaluation tool? Say I > made few changes in interpreter code and want to know if those changes > made python any better, which test should I use? Although apparently undocumented, test.pystone is some sor

Re: asyncore based port splitter code questions

2010-01-08 Thread George Trojan
Thanks for your help. Some comments below. George Giampaolo Rodola' wrote: On 4 Gen, 18:58, George Trojan wrote: Secondly, to temporarily "sleep" your connections *don't* remove anything from your map. The correct way of doing things here is to override readable() and writable() methods and

Re: Standardized interpreter speed evaluation tool

2010-01-08 Thread Terry Reedy
On 1/8/2010 5:25 AM, alexru wrote: Is there any standardized interpreter speed evaluation tool? Say I made few changes in interpreter code and want to know if those changes made python any better, which test should I use? The Unladen Swallow (sp?) project at code.google.com/, which looks t

Re: Caching objects in a C extension

2010-01-08 Thread Terry Reedy
On 1/8/2010 12:50 PM, casevh wrote: These are numeric objects created by gmpy. I'm trying to minimize the overhead for using mpz with small numbers. Objects are created and deleted very often by the interpreter as expressions are evaluated. I don't keep ownership of the objects. CPython create

Re: Recommended "new" way for config files

2010-01-08 Thread Ben Finney
Chris Rebert writes: > JSON is one option: http://docs.python.org/library/json.html YAML http://en.wikipedia.org/wiki/YAML> is another contender. Compared to JSON, it is yet to gain as much mind-share, but even more human-friendly and no less expressive. Here are some discussions of YAML that c

Re: Scripting

2010-01-08 Thread Ben Finney
Jorgen Grahn writes: > Regarding the book's title: is it just me, or are Python programmers > in general put off when people call it "scripting"? The term “script” for a Python program is part of the official terminology, so those who would be put off by that term have to at least contend with t

24 bit signed integer binary conversion help needed

2010-01-08 Thread Robert Somerville
thanks Grant, your sext24 function does the trick (this Python newbie thanks you a lot ...) so i loop on d=wave.readframes(1) call dd=sext24(d) on the frame read , then ddd=struct.unpack("<%ul" % 1 ,dd) unpack(dd) the output of sext24 into a 32bit integer (seems to do the trick correctly f

Re: lightweight encryption of text file

2010-01-08 Thread Chris Colbert
PyCrypto is already pretty easy to use by itself. I dont know why you want a wrapper on top of it. On Fri, Jan 8, 2010 at 11:02 PM, Irmen de Jong wrote: > On 8-1-2010 22:39, Daniel Fetchinson wrote: > >> >>>http://www.nightsong.com/phr/crypto/p3.py >>> >> >> Thanks a lot, currently I'm having

Re: Dynamic text color

2010-01-08 Thread Dave McCormick
John Posner wrote: On Fri, 08 Jan 2010 14:28:57 -0500, MRAB wrote: The regex r'\bgreenList_regexp\b' will match the string 'greenList_regexp' if it's a whole word. What you mean is "any of these words, provided that they're whole words". You'll need to group the alternatives within "(?:...

24 bit signed integer binary conversion help needed

2010-01-08 Thread Robert Somerville
thanks Grant, your sext24 function does the trick (this Python newbie thanks you a lot ...) so i loop on d=wave.readframes(1)   call dd=sext24(d) on the frame read , then   unpack(dd)  the output of sext24 into a 32bit integer (seems to do the trick correctly for signed 24 bit integers ..

Re: lightweight encryption of text file

2010-01-08 Thread Robert Kern
On 2010-01-08 15:47 PM, Daniel Fetchinson wrote: I have a plain text file which I would like to protect in a very simple minded, yet for my purposes sufficient, way. I'd like to encrypt/convert it into a binary file in such a way that possession of a password allows anyone to convert it back into

Re: lightweight encryption of text file

2010-01-08 Thread Irmen de Jong
On 8-1-2010 22:39, Daniel Fetchinson wrote: http://www.nightsong.com/phr/crypto/p3.py Thanks a lot, currently I'm having trouble using this code on python 2.6 but probably some small tweaking will fix it. If you keep having issues with this module, maybe you can try this: http://www.fre

Re: Another Screwy Problem

2010-01-08 Thread J. Clifford Dyer
On Fri, Jan 08, 2010 at 03:32:34PM -0400, Victor Subervi wrote regarding Another Screwy Problem: > Date: Fri, 8 Jan 2010 15:32:34 -0400 > From: Victor Subervi > To: python-list > Subject: Another Screwy Problem > >Hi; >I have this line of code: > sql = 'select Name, Price from %sPac

Re: Another Screwy Problem

2010-01-08 Thread J. Clifford Dyer
Victor Subervi wrote: > Hi; > I have this line of code: > sql = 'select Name, Price from %sPackages where ID=%s;' % (store, pid) > which prints to this: > select Name, Price from productsPackages where ID=1; > which when I enter it into the MySQL interpreter gives me this: > mysql> select Name, P

Re: 24 bit signed integer binary conversion help needed

2010-01-08 Thread Irmen de Jong
On 8-1-2010 22:37, Grant Edwards wrote: On 2010-01-08, Irmen de Jong wrote: Are you using the standard wave module? I guess that will produce a string of 3-byte audio frames with readframes(). Won't it work to chop this up in individual 3-byte frames, then appending a '\0' char to every frame,

Re: lightweight encryption of text file

2010-01-08 Thread Daniel Fetchinson
>>> I have a plain text file which I would like to protect in a very >>> simple minded, yet for my purposes sufficient, way. I'd like to >>> encrypt/convert it into a binary file in such a way that possession of >>> a password allows anyone to convert it back into the original text >>> file while n

PIL how to display multiple images side by side

2010-01-08 Thread suresh.amritapuri
Hi, In PIL, how to display multiple images in say m rows and n colums when I have m*n images. suresh -- http://mail.python.org/mailman/listinfo/python-list

Re: 24 bit signed integer binary conversion help needed

2010-01-08 Thread Grant Edwards
On 2010-01-08, Irmen de Jong wrote: > On 8-1-2010 22:12, Robert Somerville wrote: >> hi; >> I am trying to read 24bit signed WAV format (little endian) data from a >> WAV file and convert it to 32 bit little endian integer format ... can >> anybody please tell me how to do the conversion from 24 b

Re: lightweight encryption of text file

2010-01-08 Thread Daniel Fetchinson
>> I have a plain text file which I would like to protect in a very >> simple minded, yet for my purposes sufficient, way. I'd like to >> encrypt/convert it into a binary file in such a way that possession of >> a password allows anyone to convert it back into the original text >> file while not po

Re: 24 bit signed integer binary conversion help needed

2010-01-08 Thread Grant Edwards
On 2010-01-08, Grant Edwards wrote: > On 2010-01-08, Robert Somerville wrote: > >> I am trying to read 24bit signed WAV format (little endian) data from a >> WAV file and convert it to 32 bit little endian integer format ... can >> anybody please tell me how to do the conversion from 24 bit to

Re: 24 bit signed integer binary conversion help needed

2010-01-08 Thread Irmen de Jong
On 8-1-2010 22:12, Robert Somerville wrote: hi; I am trying to read 24bit signed WAV format (little endian) data from a WAV file and convert it to 32 bit little endian integer format ... can anybody please tell me how to do the conversion from 24 bit to 32 bit with a snippet of Python code ??? T

Re: Dynamic text color

2010-01-08 Thread John Posner
On Fri, 08 Jan 2010 14:28:57 -0500, MRAB wrote: Dave McCormick wrote: On Wed, Jan 6, 2010 at 9:18 AM, John Posner > wrote: On Tue, 05 Jan 2010 16:54:44 -0500, Dave McCormick mailto:mackrac...@gmail.com>> wrote: But it is not what I am wanting.

Re: 24 bit signed integer binary conversion help needed

2010-01-08 Thread Grant Edwards
On 2010-01-08, Robert Somerville wrote: > I am trying to read 24bit signed WAV format (little endian) data from a > WAV file and convert it to 32 bit little endian integer format ... can > anybody please tell me how to do the conversion from 24 bit to 32 bit > with a snippet of Python code ???

Re: Threading change, 2.5.4 -> 2.6.1

2010-01-08 Thread Hans Mulder
anon wrote: Gib Bogle wrote: The code below runs with Python 2.5.4, but gives the following error messages with Python 2.6.1. What needs to be done to make it work? Thanks. C:\Summer09\Tutorials>python url_queue.pyw Traceback (most recent call last): File "url_queue.pyw", line 3, in import

24 bit signed integer binary conversion help needed

2010-01-08 Thread Robert Somerville
hi; I am trying to read 24bit signed WAV format (little endian) data from a WAV file and convert it to 32 bit little endian integer format ... can anybody please tell me how to do the conversion from 24 bit to 32 bit with a snippet of Python code ??? Thanks so much Robert Somerville -- http:/

Re: Another Screwy Problem

2010-01-08 Thread Carsten Haese
Victor Subervi wrote: > Hi; > I have this line of code: > sql = 'select Name, Price from %sPackages where ID=%s;' % (store, pid) > which prints to this: > select Name, Price from productsPackages where ID=1; > which when I enter it into the MySQL interpreter gives me this: > mysql> select Name, P

Re: table from csv file

2010-01-08 Thread J
On Fri, Jan 8, 2010 at 13:55, Jon Clements wrote: > On Jan 8, 5:59 pm, marlowe wrote: >> I am trying to create a table in python from a csv file where I input >> which columns I would like to see, and the table only shows those >> columns. I have attached an example of the csv file i am using, an

Re: PIL show() not working for 2nd pic

2010-01-08 Thread suresh.amritapuri
On Jan 8, 6:32 am, McColgst wrote: > Do you get any errors or warnings? > Could we see the code you ran to get this problem? > > Thanks > Sean I used to get no such file or directory showing some files in /tmp directory. But today I am getting a different type of message, which appeared yesterday

Re: asyncore based port splitter code questions

2010-01-08 Thread Giampaolo Rodola'
On 4 Gen, 18:58, George Trojan wrote: > asyncore based code is supposed to be simple, > but I need while loops and a lot of try/except clauses. First of all: you DON'T have to use while loops or anything which is blocking where by "blocking" I mean anything like time.sleep(). asyncore, just like

Re: getfirst and re

2010-01-08 Thread Victor Subervi
On Fri, Jan 8, 2010 at 3:37 PM, MRAB wrote: > Victor Subervi wrote: > >> On Fri, Jan 8, 2010 at 3:09 PM, Victor Subervi >> > victorsube...@gmail.com>> wrote: >> >> >> >>On Fri, Jan 8, 2010 at 2:52 PM, Jean-Michel Pichavant >>mailto:jeanmic...@sequans.com>> wrote: >> >>Victor Sube

Re: Dynamic text color

2010-01-08 Thread Dave McCormick
On Fri, Jan 8, 2010 at 12:28 PM, MRAB wrote: > Dave McCormick wrote: > >> >> >> On Wed, Jan 6, 2010 at 9:18 AM, John Posner > jjpos...@optimum.net>> wrote: >> >>On Tue, 05 Jan 2010 16:54:44 -0500, Dave McCormick >>mailto:mackrac...@gmail.com>> wrote: >> >>But it is not what I am w

Re: lightweight encryption of text file

2010-01-08 Thread Robert Kern
On 2010-01-08 13:14 PM, Daniel Fetchinson wrote: I have a plain text file which I would like to protect in a very simple minded, yet for my purposes sufficient, way. I'd like to encrypt/convert it into a binary file in such a way that possession of a password allows anyone to convert it back into

Re: getfirst and re

2010-01-08 Thread MRAB
Victor Subervi wrote: On Fri, Jan 8, 2010 at 3:09 PM, Victor Subervi > wrote: On Fri, Jan 8, 2010 at 2:52 PM, Jean-Michel Pichavant mailto:jeanmic...@sequans.com>> wrote: Victor Subervi wrote: On Fri, Jan 8, 2010 at 1:26 PM, Steve H

Re: getfirst and re

2010-01-08 Thread Victor Subervi
On Fri, Jan 8, 2010 at 3:21 PM, MRAB wrote: > Victor Subervi wrote: > > On Fri, Jan 8, 2010 at 1:26 PM, Steve Holden > st...@holdenweb.com>> wrote: >> >>MRAB wrote: >> > Victor Subervi wrote: >> > [snip] >> >> >> >> Code snippet: >> >> >> >> def cgiFieldStorageToDict(

Another Screwy Problem

2010-01-08 Thread Victor Subervi
Hi; I have this line of code: sql = 'select Name, Price from %sPackages where ID=%s;' % (store, pid) which prints to this: select Name, Price from productsPackages where ID=1; which when I enter it into the MySQL interpreter gives me this: mysql> select Name, Price from productsPackages where ID=

Re: Recommended "new" way for config files

2010-01-08 Thread Peter
On 01/08/2010 03:57 PM, r0g wrote: Chris Rebert wrote: On Thu, Jan 7, 2010 at 10:19 AM, Peter wrote: The .ini file is the simpliest solution, at least from the user point of view, no need to learn any python syntax. I am speaking from the point of view of a python program

Re: Dynamic text color

2010-01-08 Thread MRAB
Dave McCormick wrote: On Wed, Jan 6, 2010 at 9:18 AM, John Posner > wrote: On Tue, 05 Jan 2010 16:54:44 -0500, Dave McCormick mailto:mackrac...@gmail.com>> wrote: But it is not what I am wanting. I first thought to make it look for a space

Re: Scripting (was Re: Python books, literature etc)

2010-01-08 Thread Peter
Sounds good. Regarding the book's title: is it just me, or are Python programmers in general put off when people call it "scripting"? I won't attempt a strict definition of the term "scripting language", but it seems like non-programmers use it to mean "less scary than what you might think of

Re: getfirst and re

2010-01-08 Thread MRAB
Victor Subervi wrote: On Fri, Jan 8, 2010 at 1:26 PM, Steve Holden > wrote: MRAB wrote: > Victor Subervi wrote: > [snip] >> >> Code snippet: >> >> def cgiFieldStorageToDict(fieldStorage):

Re: getfirst and re

2010-01-08 Thread Victor Subervi
On Fri, Jan 8, 2010 at 3:09 PM, Victor Subervi wrote: > > > On Fri, Jan 8, 2010 at 2:52 PM, Jean-Michel Pichavant < > jeanmic...@sequans.com> wrote: > >> Victor Subervi wrote: >> >> On Fri, Jan 8, 2010 at 1:26 PM, Steve Holden >> st...@holdenweb.com>> wrote: >>> >>>MRAB wrote: >>>> Victor

lightweight encryption of text file

2010-01-08 Thread Daniel Fetchinson
I have a plain text file which I would like to protect in a very simple minded, yet for my purposes sufficient, way. I'd like to encrypt/convert it into a binary file in such a way that possession of a password allows anyone to convert it back into the original text file while not possessing the pa

Mencoder not working from a python script

2010-01-08 Thread aditya shukla
Hello guys, I am trying to create a python script which uses mencoder to create videos from a set of images.When I am using the command(windows 7) i am able to generate the video properly.But when used within a python script i am ggetting error.Below is the code and error.any help is appreciated.

Re: getfirst and re

2010-01-08 Thread Victor Subervi
On Fri, Jan 8, 2010 at 2:52 PM, Jean-Michel Pichavant < jeanmic...@sequans.com> wrote: > Victor Subervi wrote: > > On Fri, Jan 8, 2010 at 1:26 PM, Steve Holden > st...@holdenweb.com>> wrote: >> >>MRAB wrote: >>> Victor Subervi wrote: >>> [snip] >>>> >>>> Code snippet: >>>>

Re: Manipulating pointers in C using ctypes

2010-01-08 Thread Jason Scheirer
On Jan 8, 7:37 am, Daniel Platz wrote: > Hello! > > I have to ask a newbie question about manipulating pointers in C using > ctypes. I have a C dll with two functions. The first one creates a > pointer and returns it to python. The second one takes a pointer as an > argument shows its address and

Re: getfirst and re

2010-01-08 Thread Victor Subervi
On Fri, Jan 8, 2010 at 2:52 PM, Jean-Michel Pichavant < jeanmic...@sequans.com> wrote: > Victor Subervi wrote: > > On Fri, Jan 8, 2010 at 1:26 PM, Steve Holden > st...@holdenweb.com>> wrote: >> >>MRAB wrote: >>> Victor Subervi wrote: >>> [snip] >>>> >>>> Code snippet: >>>>

Re: table from csv file

2010-01-08 Thread Jon Clements
On Jan 8, 5:59 pm, marlowe wrote: > I am trying to create a table in python from a csv file where I input > which columns I would like to see, and the table only shows those > columns. I have attached an example of the csv file i am using, and > some of the code I have written. I am having trouble

Re: Recommended "new" way for config files

2010-01-08 Thread Vinay Sajip
On Jan 7, 8:12 pm, Peter wrote: > > > > >> So what is the "worshipped" approach, when you need more than name=value > >> pairs ? > > > JSON is one option:http://docs.python.org/library/json.html > > Thanks, didn't think about that, although most of the apps I know don't > seem to use this approac

Re: getfirst and re

2010-01-08 Thread Jean-Michel Pichavant
Victor Subervi wrote: On Fri, Jan 8, 2010 at 1:26 PM, Steve Holden > wrote: MRAB wrote: > Victor Subervi wrote: > [snip] >> >> Code snippet: >> >> def cgiFieldStorageToDict(fieldStorage): Fur

Re: getfirst and re

2010-01-08 Thread Victor Subervi
On Fri, Jan 8, 2010 at 1:26 PM, Steve Holden wrote: > MRAB wrote: > > Victor Subervi wrote: > > [snip] > >> > >> Code snippet: > >> > >> def cgiFieldStorageToDict(fieldStorage): > > Further hint ... > > >> params = {} > >> for key in fieldStorage.keys

Re: Dynamic text color

2010-01-08 Thread Dave McCormick
On Wed, Jan 6, 2010 at 9:18 AM, John Posner wrote: > On Tue, 05 Jan 2010 16:54:44 -0500, Dave McCormick > wrote: > > But it is not what I am wanting. I first thought to make it look for a >> space but that would not work when a single character like "#" is to be >> colored if there is a "string

Re: Need help to pass self.count to other classes.

2010-01-08 Thread Peter Otten
Steve Holden wrote: > Steven D'Aprano wrote: > [... points out my misapprehension ...] >> > kbi = kbInterface() > sys.ps1 = kbi.prompt1 >> > 0xb7cbd52c>>print "Hello" >> Hello >> > 0xb7cbd52c>> >> > Right, this is expert mode ... Here's a way to turn expert mode into something less adva

table from csv file

2010-01-08 Thread marlowe
I am trying to create a table in python from a csv file where I input which columns I would like to see, and the table only shows those columns. I have attached an example of the csv file i am using, and some of the code I have written. I am having trouble converting variables between lists, dictio

monitor reading file with thread

2010-01-08 Thread wiso
I'm reading and processing a huge file, so during the execution I want to now the state of the processing: how many lines are already processed, and so on. The first approach is: f = open(filename) n = 0 for l in f: if n % 1000 = 0: print "Reading %d lines" %n do_something(l) but I want

Re: Caching objects in a C extension

2010-01-08 Thread casevh
On Jan 8, 9:19 am, "Diez B. Roggisch" wrote: > casevh schrieb: > > > > > > > On Jan 8, 2:59 am, "Diez B. Roggisch" wrote: > >> casevh schrieb: > > >>> I'm working with a C extension that needs to rapidly create and delete > >>> objects. I came up with an approach to cache objects that are being >

Re: getfirst and re

2010-01-08 Thread Steve Holden
MRAB wrote: > Victor Subervi wrote: > [snip] >> >> Code snippet: >> >> def cgiFieldStorageToDict(fieldStorage): Further hint ... >> params = {} >> for key in fieldStorage.keys(): >> params[key] = cgi.FieldStorage[key].value > ^^

Re: Caching objects in a C extension

2010-01-08 Thread Diez B. Roggisch
casevh schrieb: On Jan 8, 2:59 am, "Diez B. Roggisch" wrote: casevh schrieb: I'm working with a C extension that needs to rapidly create and delete objects. I came up with an approach to cache objects that are being deleted and resurrect them instead of creating new objects. It appears to

Re: PyQt QThreadPool error

2010-01-08 Thread h0uk
On 8 янв, 16:27, Phil Thompson wrote: > On Thu, 7 Jan 2010 15:07:10 -0800 (PST), h0uk > wrote: > > ... > > > > > Phil you right about app.exec_(). But situation is sligthly different. > > > I want to have more than one Job. I add these Jobs into QThreadPool > > trough cycle. And I also want these

Re: One function calling another defined in the same file being exec'd

2010-01-08 Thread Mitchell L Model
On Jan 8, 2010, at 9:55 AM, "Gabriel Genellina" p...@yahoo.com.ar> wrote: Ok - short answer or long answer? Short answer: Emulate how modules work. Make globals() same as locals(). (BTW, are you sure you want the file to run with the *same* globals as the caller? It sees the dofile() fun

Re: One function calling another defined in the same file being exec'd

2010-01-08 Thread Mitchell L Model
On Jan 7, 2010, at 10:45 PM, Steven D'Aprano > wrote an extensive answer to my questions about one function calling another in the same file being exec'd. His suggestion about printing out locals() and globals() in the various possible places provided the clues to explain what was going on.

Re: Caching objects in a C extension

2010-01-08 Thread Antoine Pitrou
Le Fri, 08 Jan 2010 08:39:17 -0800, casevh a écrit : > > Thanks for the reply. I realized that I missed one detail. The objects > are created by the extension but are deleted by Python. I don't know > that an object is no longer needed until its tp_dealloc is called. At > that point, its reference

Re: Caching objects in a C extension

2010-01-08 Thread casevh
On Jan 8, 2:59 am, "Diez B. Roggisch" wrote: > casevh schrieb: > > > > > > > I'm working with a C extension that needs to rapidly create and delete > > objects. I came up with an approach to cache objects that are being > > deleted and resurrect them instead of creating new objects. It appears > >

Re: restructuredText editor ?

2010-01-08 Thread Diez B. Roggisch
Peter schrieb: What editor do people out there use to edit .rst files for sphinx-python documentation ? Emacs has a RST-mode (which unfortunately has some runtime-issues, the longer the text & the edit, the slower it gets), and together with flymake & rst2xml, you get nice error-notification

Re: Scripting (was Re: Python books, literature etc)

2010-01-08 Thread MRAB
Jorgen Grahn wrote: On Thu, 2010-01-07, Peter wrote: [...] depending on your application domain, I liked: 1) Hans Petter Langtangen: Python Scripting for Computational Science A truly excellent book, not only with respect to Python Scripting , but also on how to avoid paying license fees by

Re: File transfer with python

2010-01-08 Thread Kamill Sokol
On Jan 6, 7:00 pm, Valentin de Pablo Fouce wrote: > Hi there, > > My intention is to transfer files from one > computer to another. > Hi Valentin, take a look at dropbox! Clients are available for mac, linux and windows. Up and running in just 2 minutes. http://dropbox.com Regards Kamill -- h

Re: please help shrink this each_with_index() implementation

2010-01-08 Thread Roel Schroeven
Phlip schreef: > Nobody wrote: >> Writing robust software from the outset puts you at a competitive >> disadvantage to those who understand how the system works. > > And I, not my language, should pick and chose how to be rigorous. The > language > should not make the decision for me. You can a

restructuredText editor ?

2010-01-08 Thread Peter
What editor do people out there use to edit .rst files for sphinx-python documentation ? Peter -- http://mail.python.org/mailman/listinfo/python-list

Advanced Python Programming - March 8-12, 2010

2010-01-08 Thread Chander Ganesan
Looking to make the most of Python's advanced features? Then this is the class for you! The Open Technology Group's Advanced Python Programming course focuses on topics of interest to experienced Python programmers, and teaches you how to leverage advanced features and functionality of Python

Manipulating pointers in C using ctypes

2010-01-08 Thread Daniel Platz
Hello! I have to ask a newbie question about manipulating pointers in C using ctypes. I have a C dll with two functions. The first one creates a pointer and returns it to python. The second one takes a pointer as an argument shows its address and the value at which it is pointing. This I have impl

Re: getfirst and re

2010-01-08 Thread MRAB
Victor Subervi wrote: [snip] Code snippet: def cgiFieldStorageToDict(fieldStorage): params = {} for key in fieldStorage.keys(): params[key] = cgi.FieldStorage[key].value ^ This is your problem. return params [snip] -- http://mail.python.or

Re: C Module's '1.#INF' changes to 'inf' at Python

2010-01-08 Thread Robert Kern
On 2010-01-08 07:48 AM, CELEN Erman wrote: Hi All, My problem is that I’ve noticed a strange behavior in Python while handling FPEs on Windows after switching compilers (msvc8 to msvc9) and I am trying to find out how Python handles INF values to figure out where the problem might be. The probl

Re: Accessing python from a network share in windows 7

2010-01-08 Thread r0g
aj wrote: > On Jan 7, 3:51 pm, MRAB wrote: >> aj wrote: > It works without any issue on win7 if I copy python to my local drive. > Also, accessing python from the same network share works fine on win > XP. So I am suspecting some security policy of win7 that is causing > problem while accessing it

Re: Recommended "new" way for config files

2010-01-08 Thread r0g
Chris Rebert wrote: > On Thu, Jan 7, 2010 at 10:19 AM, Peter wrote: > >>> The .ini file is the simpliest solution, at least from the user point of >>> view, no need to learn any python syntax. >> I am speaking from the point of view of a python programmer, and I find the >> .ini restrictions not

Re: Scripting (was Re: Python books, literature etc)

2010-01-08 Thread J
On Fri, Jan 8, 2010 at 09:37, Jorgen Grahn wrote: > Regarding the book's title: is it just me, or are Python programmers > in general put off when people call it "scripting"? > > I won't attempt a strict definition of the term "scripting language", > but it seems like non-programmers use it to mea

Re: getfirst and re

2010-01-08 Thread Carsten Haese
Victor Subervi wrote: > First I get scolded for not including enough information. Now I get > scolded for including too much. Seems I can't win. I *am* putting effort > into understanding this. I'm sorry I'm not as sharp as you are in these > matters. I didn't scold you for including too much info

Re: Recommended "new" way for config files

2010-01-08 Thread Jorgen Grahn
On Thu, 2010-01-07, Jean-Michel Pichavant wrote: > Peter wrote: >> Hi >> There seems to be several strategies to enhance the old ini-style >> config files with real python code, for example: ... >> Is there a strategy that should be prefered for new projects ? ... > The .ini file is the simpliest

Re: One function calling another defined in the same file being exec'd

2010-01-08 Thread Gabriel Genellina
En Thu, 07 Jan 2010 19:47:13 -0300, Mitchell L Model escribió: def dofile(filename): ldict = {'result': None} with open(filename) as file: exec(file.read(), globals(), ldict) print('Result for {}: {}'.format(filename, ldict['result'])) Next I call dof

C Module's '1.#INF' changes to 'inf' at Python

2010-01-08 Thread CELEN Erman
Hi All, My problem is that I've noticed a strange behavior in Python while handling FPEs on Windows after switching compilers (msvc8 to msvc9) and I am trying to find out how Python handles INF values to figure out where the problem might be. The problem appeared when we noticed that be

Re: getfirst and re

2010-01-08 Thread Steve Holden
Victor Subervi wrote: [...] > TypeError: unsubscriptable object > args = ('unsubscriptable object',) > > Why is the value undefined? What is an unsubscriptable object? > TIA, > beno > Sorry, that wasn't very helpful. Here's some more advice: Google is you friend. Try Googling for component

Scripting (was Re: Python books, literature etc)

2010-01-08 Thread Jorgen Grahn
On Thu, 2010-01-07, Peter wrote: > [...] depending on your > application domain, I liked: > > 1) Hans Petter Langtangen: Python Scripting for Computational Science > A truly excellent book, not only with respect to Python Scripting , but > also on how to avoid paying license fees by using opens

Re: getfirst and re

2010-01-08 Thread Steve Holden
Victor Subervi wrote: > On Fri, Jan 8, 2010 at 10:11 AM, Carsten Haese > wrote: > > Victor Subervi wrote: > > Code snippet: > > [...] > > > > Error: > > [...] > > What do? > > After eliminating the pieces of your post that have been

Re: PIL show() not working for 2nd pic

2010-01-08 Thread McColgst
Do you get any errors or warnings? Could we see the code you ran to get this problem? Thanks Sean -- http://mail.python.org/mailman/listinfo/python-list

Re: Do I have to use threads?

2010-01-08 Thread r0g
Marco Salden wrote: > On Jan 6, 5:36 am, Philip Semanchuk wrote: >> On Jan 5, 2010, at 11:26 PM, aditya shukla wrote: >> >>> Hello people, >>> I have 5 directories corresponding 5 different urls .I want to >>> download >>> images from those urls and place them in the respective >>> directorie

Re: Do I have to use threads?

2010-01-08 Thread Jorgen Grahn
On Wed, 2010-01-06, Gary Herron wrote: > aditya shukla wrote: >> Hello people, >> >> I have 5 directories corresponding 5 different urls .I want to >> download images from those urls and place them in the respective >> directories.I have to extract the contents and download them >> simultaneous

Re: getfirst and re

2010-01-08 Thread Victor Subervi
On Fri, Jan 8, 2010 at 10:11 AM, Carsten Haese wrote: > Victor Subervi wrote: > > Code snippet: > > [...] > > > > Error: > > [...] > > What do? > > After eliminating the pieces of your post that have been copied or > quoted from elsewhere, I am left with a total of five words of your own > to ask

Re: getfirst and re

2010-01-08 Thread Carsten Haese
Victor Subervi wrote: > Code snippet: > [...] > > Error: > [...] > What do? After eliminating the pieces of your post that have been copied or quoted from elsewhere, I am left with a total of five words of your own to ask this question, which seems to be approximately the same amount of effort yo

Re: How to execute a script from another script and other script does not do busy wait.

2010-01-08 Thread Jorgen Grahn
On Thu, 2010-01-07, danmcle...@yahoo.com wrote: > On Jan 7, 9:18 am, Jorgen Grahn wrote: >> On Thu, 2010-01-07, Rajat wrote: >> > I want to run a python script( aka script2) from another python script >> > (aka script1). While script1 executes script2 it waits for script2 to >> > complete and in d

Re: Need help to pass self.count to other classes.

2010-01-08 Thread Steve Holden
Steven D'Aprano wrote: [... points out my misapprehension ...] > kbi = kbInterface() sys.ps1 = kbi.prompt1 > 0xb7cbd52c>>print "Hello" > Hello > 0xb7cbd52c>> > Right, this is expert mode ... regards Steve -- Steve Holden +1 571 484 6266 +1 800 494 3119 PyCon is coming!

dtd validation on python 3.1 on Windows.

2010-01-08 Thread VYAS ASHISH M-NTB837
What is the best way to validate xmls against my dtd in python? I dont see minodom doing this. Sax has dtd validation, but does not complain on dtd violations. (it does access the dtd, if it does not find dtd it complains me.) I am using python 3.1 on Win32 machine. I was planning to try

SQLObject 0.12.1

2010-01-08 Thread Oleg Broytman
Hello! I'm pleased to announce version 0.12.1, a bugfix release of branch 0.12 of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be easy to u

SQLObject 0.11.3

2010-01-08 Thread Oleg Broytman
Hello! I'm pleased to announce version 0.11.3, a minor bugfix release of 0.11 branch of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be eas

  1   2   >