Re: from datetime.datetime import today not working. python2.6.4 on windows

2010-01-06 Thread Joshua Kordani
Gary Herron wrote: Joshua Kordani wrote: Greetings all! So I'm reading through the manual and I get to the point where it talks about packages and how to import them. namely section 6.4 in the tutorial. I wont repeat the section here, but I want to understand whats going on in the followin

Re: How to reduce the memory size of python

2010-01-06 Thread Steve Holden
Mishra Gopal-QBX634 wrote: > Hi, > > When i write following pyhon program and execute it in linux machine, > > if __name__=='__main__': > while True: > pass > > When i check the VmRSS size, it shows 2956 KB in size. > > Is there any way to reduce the memory size taken by pytho

Re: Exception as the primary error handling mechanism?

2010-01-06 Thread Steve Holden
r0g wrote: > r0g wrote: >> Steven D'Aprano wrote: >>> On Wed, 06 Jan 2010 23:58:21 +, r0g wrote: >>> Steven D'Aprano wrote: > On Wed, 06 Jan 2010 22:46:33 +, r0g wrote: > >> Grant Edwards wrote: >>> On 2010-01-06, r0g wrote: See? Spoiling for an argument even now!

Re: Python interactive terminal in Ubuntu Linux : some keys fouled up

2010-01-06 Thread t r z e w i c z e k
On Thu, 07 Jan 2010 01:09:08 +0100, casevh wrote: On Jan 6, 2:40 pm, pdlem...@earthlink.net wrote: Have recently moved from XP to Ubuntu Linux. Successfully installed Python 3.1.1 in the Ubuntu 9.04 release on my desktop. Problem is the python interactive terminal >>> . Many of the keys now d

Re: Validating cells of a table PyQt

2010-01-06 Thread t r z e w i c z e k
On Thu, 07 Jan 2010 01:37:05 +0100, Zabin wrote: Hey! I am new PyQT programmer. I am trying to create a table in which cells only take in numeric data. I am unable to use setValidator on table cells. Looking around i found some material on the editor attribute but I dont know how to apply this

How to reduce the memory size of python

2010-01-06 Thread Mishra Gopal-QBX634
Hi, When i write following pyhon program and execute it in linux machine, if __name__=='__main__': while True: pass When i check the VmRSS size, it shows 2956 KB in size. Is there any way to reduce the memory size taken by python. I am working in flash memory devices. Any

Re: Exception as the primary error handling mechanism?

2010-01-06 Thread r0g
r0g wrote: > Steven D'Aprano wrote: >> On Wed, 06 Jan 2010 23:58:21 +, r0g wrote: >> >>> Steven D'Aprano wrote: On Wed, 06 Jan 2010 22:46:33 +, r0g wrote: > Grant Edwards wrote: >> On 2010-01-06, r0g wrote: >>> See? Spoiling for an argument even now! I never said you were

Re: Pass multidimensional array (matrix) to c function using ctypes

2010-01-06 Thread Mark Tolonen
"Daniel Platz" wrote in message news:63ac1a01-8491-4885-bae7-cb884abb5...@34g2000yqp.googlegroups.com... Hello, I would like to pass a two dimensional array to C function in a dll. I use ctypes to call the function. I compile the dll with visual studio 2008 express and my C source code looks

Re: from datetime.datetime import today not working. python2.6.4 on windows

2010-01-06 Thread Gary Herron
Joshua Kordani wrote: Greetings all! So I'm reading through the manual and I get to the point where it talks about packages and how to import them. namely section 6.4 in the tutorial. I wont repeat the section here, but I want to understand whats going on in the following (as typed on my co

Re: from datetime.datetime import today not working. python2.6.4 on windows

2010-01-06 Thread Steve Holden
Joshua Kordani wrote: > Greetings all! > > So I'm reading through the manual and I get to the point where it talks > about packages and how to import them. namely section 6.4 in the > tutorial. I wont repeat the section here, but I want to understand > whats going on in the following (as typed o

Re: from datetime.datetime import today not working. python2.6.4 on windows

2010-01-06 Thread Benjamin Kaplan
On Thu, Jan 7, 2010 at 12:07 AM, Joshua Kordani wrote: > Greetings all! > > So I'm reading through the manual and I get to the point where it talks > about packages and how to import them.  namely section 6.4 in the tutorial. >  I wont repeat the section here, but I want to understand whats going

from datetime.datetime import today not working. python2.6.4 on windows

2010-01-06 Thread Joshua Kordani
Greetings all! So I'm reading through the manual and I get to the point where it talks about packages and how to import them. namely section 6.4 in the tutorial. I wont repeat the section here, but I want to understand whats going on in the following (as typed on my computer). Python 2.6.4

RE: lxml 2.2.4 on python3.1, Windows XP gives importerror

2010-01-06 Thread VYAS ASHISH M-NTB837
Processor is Intel Pentium 32 bit. import platform print (platform.architecture()) gives -> ('32bit', 'WindowsPE') Regards, Ashish Vyas -Original Message- From: Sridhar Ratnakumar [mailto:sridh...@activestate.com] Sent: Wednesday, January 06, 2010 10:15 PM To: VYAS ASHISH M-NTB837 C

Re: Assertions, challenges, and polite discourse

2010-01-06 Thread r0g
alex23 wrote: > r0g wrote: >> Well I think sometimes, for the sake of expediency and overall >> pleasantness, it's better to let the smaller things go: and if you just >> can't let them go then at least try and issue corrections in a friendly >> manner rather than a cold or pious one. > > The iro

Re: GUI for multiplatform multimedia project

2010-01-06 Thread r0g
Philip Semanchuk wrote: > > On Jan 6, 2010, at 4:53 PM, > wrote: > >> Hi everyone, >> >> I posted that question on a python-forum, but got answer, so I ask here. >> >> I'm working on an artistic project and I'm looking for the best >> cross-platform GUI solution. The problem is that it's gonna

Re: GUI for multiplatform multimedia project

2010-01-06 Thread Philip Semanchuk
On Jan 6, 2010, at 4:53 PM, > wrote: Hi everyone, I posted that question on a python-forum, but got answer, so I ask here. I'm working on an artistic project and I'm looking for the best cross-platform GUI solution. The problem is that it's gonna be a tool that will have to be double-c

Re: TypeError

2010-01-06 Thread Steve Holden
John Machin wrote: > On Jan 7, 1:38 pm, Steve Holden wrote: >> John Machin wrote: >> >> [...]> I note that in the code shown there are examples of building an SQL >>> query where the table name is concocted at runtime via the % >>> operator ... key phrases: "bad database design" (one table per >>>

Re: Astronomy--Programs to Compute Siderial Time?

2010-01-06 Thread W. eWatson
John Machin wrote: On Jan 7, 11:40 am, "W. eWatson" wrote: W. eWatson wrote: Is there a smallish Python library of basic astronomical functions? There are a number of large such libraries that are crammed with excessive functions not needed for common calculations. It looks like I've entered

Re: QDoubleValidator

2010-01-06 Thread John Posner
On Wed, 06 Jan 2010 17:47:37 -0500, Zabin wrote: On Jan 7, 10:23 am, Zabin wrote: Hey! I am new PyQt programmer and want to restrict users to allow only numeric values into a table and lineedit boxes. I found the QDoubleValidator class but am unsure as to how to implement it. (I am a little

Re: TypeError

2010-01-06 Thread John Machin
On Jan 7, 1:38 pm, Steve Holden wrote: > John Machin wrote: > > [...]> I note that in the code shown there are examples of building an SQL > > query where the table name is concocted at runtime via the % > > operator ... key phrases: "bad database design" (one table per > > store!), "SQL injection

Re: subprocess.Popen does not close pipe in an error case

2010-01-06 Thread Steven K. Wong
Well, the example code at http://www.python.org/doc/2.6.2/library/subprocess.html#replacing-shell-pipeline has the same issue: output=`dmesg | grep hda` ==> p1 = Popen(["dmesg"], stdout=PIPE) p2 = Popen(["grep", "hda"], stdin=p1.stdout, stdout=PIPE) output = p2.communicate()[0] After communicate

Re: Assertions, challenges, and polite discourse

2010-01-06 Thread alex23
r0g wrote: > Well I think sometimes, for the sake of expediency and overall > pleasantness, it's better to let the smaller things go: and if you just > can't let them go then at least try and issue corrections in a friendly > manner rather than a cold or pious one. The irony, it is too rich... --

Re: TypeError

2010-01-06 Thread Steve Holden
Steve Holden wrote: > John Machin wrote: > [...] >> I note that in the code shown there are examples of building an SQL >> query where the table name is concocted at runtime via the % >> operator ... key phrases: "bad database design" (one table per >> store!), "SQL injection attack" >> > I'm not t

Re: TypeError

2010-01-06 Thread Steve Holden
John Machin wrote: [...] > I note that in the code shown there are examples of building an SQL > query where the table name is concocted at runtime via the % > operator ... key phrases: "bad database design" (one table per > store!), "SQL injection attack" > I'm not trying to defend the code overa

Re: Exception as the primary error handling mechanism?

2010-01-06 Thread r0g
Steven D'Aprano wrote: > On Wed, 06 Jan 2010 23:58:21 +, r0g wrote: > >> Steven D'Aprano wrote: >>> On Wed, 06 Jan 2010 22:46:33 +, r0g wrote: >>> Grant Edwards wrote: > On 2010-01-06, r0g wrote: >> See? Spoiling for an argument even now! I never said you weren't allowed >> to bu

Re: Astronomy--Programs to Compute Siderial Time?

2010-01-06 Thread John Machin
On Jan 7, 11:40 am, "W. eWatson" wrote: > W. eWatson wrote: > > Is there a smallish Python library of basic astronomical functions? > > There are a number of large such libraries that are crammed with > > excessive functions not needed for common calculations. > > It looks like I've entered a new

Re: Astronomy--Programs to Compute Siderial Time?

2010-01-06 Thread W. eWatson
Roy Smith wrote: In article , "W. eWatson" wrote: Is there a smallish Python library of basic astronomical functions? There are a number of large such libraries that are crammed with excessive functions not needed for common calculations. FWIW, if you have any interest in this kind of stuf

Re: Assertions, challenges, and polite discourse

2010-01-06 Thread r0g
Ben Finney wrote: > r0g writes: > >> Ben Finney wrote: >>> People sometimes get upset — on an immediate, irrational level — >>> when their assertions are challenged. There's no denying that >>> emotions entangle our discourse, and our interpretation of the >>> discourse of others. >> That's truer

Re: Exception as the primary error handling mechanism?

2010-01-06 Thread Steven D'Aprano
On Wed, 06 Jan 2010 23:58:21 +, r0g wrote: > Steven D'Aprano wrote: >> On Wed, 06 Jan 2010 22:46:33 +, r0g wrote: >> >>> Grant Edwards wrote: On 2010-01-06, r0g wrote: > NO! It's a rude way to start a sentence don't you think? No. When somebody asks a yes/no question,

Re: TypeError

2010-01-06 Thread John Machin
On Jan 7, 11:14 am, John Machin wrote: > On Jan 7, 3:29 am, MRAB wrote: > > > Victor Subervi wrote: > > > ValueError: unsupported format character '(' (0x28) at index 54 > > >       args = ("unsupported format character '(' (0x28) at index 54",) > > > > Apparently that character is a "file separa

Re: Astronomy--Programs to Compute Siderial Time?

2010-01-06 Thread Roy Smith
In article , "W. eWatson" wrote: > Is there a smallish Python library of basic astronomical functions? > There are a number of large such libraries that are crammed with > excessive functions not needed for common calculations. FWIW, if you have any interest in this kind of stuff, you must re

Re: parsing an Excel formula with the re module

2010-01-06 Thread John Machin
On Jan 6, 6:54 am, vsoler wrote: > On 5 ene, 20:21, vsoler wrote: > > > > > On 5 ene, 20:05, Mensanator wrote: > > > > On Jan 5, 12:35 pm, MRAB wrote: > > > > > vsoler wrote: > > > > > Hello, > > > > > > I am acessing an Excel file by means of Win 32 COM technology. > > > > > For a given cell,

Re: Assertions, challenges, and polite discourse

2010-01-06 Thread Ben Finney
r0g writes: > Ben Finney wrote: > > People sometimes get upset — on an immediate, irrational level — > > when their assertions are challenged. There's no denying that > > emotions entangle our discourse, and our interpretation of the > > discourse of others. > > That's truer than most people appr

Re: please help shrink this each_with_index() implementation

2010-01-06 Thread Carl Banks
On Jan 6, 12:12 pm, Phlip wrote: > 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 fo

Re: File transfer with python

2010-01-06 Thread alex23
Valentin de Pablo Fouce wrote: > My intention is to be able to transfer files from one computer to > another in this environment. > > Looking (and surfing) at internet the only suggestion given is to use > low level sockets for this file transfer. Is there another way to do > it, is there any top

Re: Astronomy--Programs to Compute Siderial Time?

2010-01-06 Thread W. eWatson
W. eWatson wrote: Is there a smallish Python library of basic astronomical functions? There are a number of large such libraries that are crammed with excessive functions not needed for common calculations. It looks like I've entered a new era in my knowledge of Python. I found a module somewha

Validating cells of a table PyQt

2010-01-06 Thread Zabin
Hey! I am new PyQT programmer. I am trying to create a table in which cells only take in numeric data. I am unable to use setValidator on table cells. Looking around i found some material on the editor attribute but I dont know how to apply this. Any help will be appreciated Cheers! -- http://ma

Re: Assertions, challenges, and polite discourse

2010-01-06 Thread r0g
Ben Finney wrote: > In fairness, the “No” was in response, not to an explicit question, but > to an assertion. > > Every assertion expressed, though, implies the question “is this > assertion true?”. It was that question that was answered “No” (followed > by an explanation of why the assertion was

Re: please help shrink this each_with_index() implementation

2010-01-06 Thread alex23
Phlip wrote: > And I, not my language, should pick and chose how to be rigorous. The language > should not make the decision for me. Since you seem unwilling to put the minimal effort into producing the support code you'd need to work with Python the way you want, perhaps Perl might be more to yo

Re: 3 byte network ordered int, How To ?

2010-01-06 Thread John Machin
On Jan 7, 5:33 am, Matthew Barnett wrote: > mudit tuli wrote: > > For a single byte, struct.pack(') > > For two bytes, struct.pack(') > > what if I want three bytes ? > > Four bytes and then discard the most-significant byte: > > struct.pack(')[ : -1] AARRGGHH! network ordering is BIGendian, stru

Re: TypeError

2010-01-06 Thread John Machin
On Jan 7, 3:29 am, MRAB wrote: > Victor Subervi wrote: > > ValueError: unsupported format character '(' (0x28) at index 54 > >       args = ("unsupported format character '(' (0x28) at index 54",) > > > Apparently that character is a "file separator", which I presume is an > > invisible character

Re: suds problem

2010-01-06 Thread Fencer
On 2010-01-06 20:02, Fencer wrote: On 2010-01-06 19:33, Fencer wrote: Hello, I just started using suds to use web services. First I tried suds with a very simple web service I had written and was running myself. That worked fine. Then I tried to use the web services provided by KEGG: http://soap

Re: Python interactive terminal in Ubuntu Linux : some keys fouled up

2010-01-06 Thread casevh
On Jan 6, 2:40 pm, pdlem...@earthlink.net wrote: > Have recently moved from XP to Ubuntu Linux. > Successfully installed Python 3.1.1 in the Ubuntu 9.04 > release on my desktop. > Problem is the python interactive terminal  >>> . > Many of the keys now do not work. > eg pressing left-arrow yields  

Re: Exception as the primary error handling mechanism?

2010-01-06 Thread r0g
Steven D'Aprano wrote: > On Wed, 06 Jan 2010 22:46:33 +, r0g wrote: > >> Grant Edwards wrote: >>> On 2010-01-06, r0g wrote: >>> NO! It's a rude way to start a sentence don't you think? >>> No. When somebody asks a yes/no question, answering yes or no seems >>> quite polite to me. Follo

Assertions, challenges, and polite discourse (was: Exception as the primary error handling mechanism?)

2010-01-06 Thread Ben Finney
Grant Edwards writes: > Answering a yes/no question with "no" doesn't seem to me to be > combative if the correct answer is indeed "no". But I've lost > track of the post you found objectionable... In fairness, the “No” was in response, not to an explicit question, but to an assertion. Every a

Re: python xmlrpc client with ssl client certificates and standard modules

2010-01-06 Thread Martin v. Loewis
> My next task is how to find out at the client side, that the server > certificate is a properly signed one. As Heikki says, you'll need Python 2.6 for that. You'll probably need to extend your transport implementation. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Exception as the primary error handling mechanism?

2010-01-06 Thread Steven D'Aprano
On Wed, 06 Jan 2010 22:46:33 +, r0g wrote: > Grant Edwards wrote: >> On 2010-01-06, r0g wrote: >> >>> NO! It's a rude way to start a sentence don't you think? >> >> No. When somebody asks a yes/no question, answering yes or no seems >> quite polite to me. Following the yes/no answer with

Re: please help shrink this each_with_index() implementation

2010-01-06 Thread Antoine Pitrou
Le Wed, 06 Jan 2010 12:12:08 -0800, Phlip a écrit : > > And I, not my language, should pick and chose how to be rigorous. The > language should not make the decision for me. And that's why there is the "try: ... except: ..." construct. Your rant is getting tiring. -- http://mail.python.org/mai

Re: Mencoder and creating videos

2010-01-06 Thread r0g
Emile van Sebille wrote: > On 1/6/2010 12:44 PM aditya shukla said... >> Hello Guys, >> >> I have a multiprocessing script which downloads images from 5 urls to 5 >> directories(usinf multiprocess in python 2.6).The download is for 5 >> mins.My aim is to create a video for every minute for each dir

Re: TypeError

2010-01-06 Thread r0g
MRAB wrote: > Victor Subervi wrote: >> Hi; >> I get this error: >> >> /var/www/html/angrynates.com/christians/cart/simplemail/mail.py >> >> 153 >> 154 ''' >> 155 commitSale() >> 156 myMail() >> 157 print ''' >> commitSale = >>

GUI for multiplatform multimedia project

2010-01-06 Thread trzewiczek
Hi everyone, I posted that question on a python-forum, but got answer, so I ask here. I'm working on an artistic project and I'm looking for the best cross-platform GUI solution. The problem is that it's gonna be a tool that will have to be double-click installable/runnable and pre-installation

Re: File transfer with python

2010-01-06 Thread r0g
Valentin de Pablo Fouce wrote: > Hi there, > > I hope this is the rigth place, if not please, tell me which is the > right dicussion place. I apologize in such case. > > Ok, I am trying to do a very quick application (is "home based" so is > not a big deal...). My intention is to transfer files f

Problem with multiprocessing managers

2010-01-06 Thread Metalone
>From the documentation for Using a remote manager there is the following example code: from multiprocessing.managers import BaseManager import Queue queue = Queue.Queue() class QueueManager(BaseManager): pass QueueManager.register('get_queue', callable=lambda:queue) m = QueueManager(address=('',

Re: QDoubleValidator

2010-01-06 Thread Zabin
On Jan 7, 10:23 am, Zabin wrote: > Hey! > > I am new PyQt programmer and want to restrict users to allow only > numeric values into a table and lineedit boxes. I found the > QDoubleValidator class but am unsure as to how to implement it. (I am > a little shaky on the concept of parent and how to d

Re: Exception as the primary error handling mechanism?

2010-01-06 Thread r0g
Grant Edwards wrote: > On 2010-01-06, r0g wrote: > >> NO! It's a rude way to start a sentence don't you think? > > No. When somebody asks a yes/no question, answering yes or no > seems quite polite to me. Following the yes/no answer with an > explanation of the answer is always nice, and I've

Python interactive terminal in Ubuntu Linux : some keys fouled up

2010-01-06 Thread pdlemper
Have recently moved from XP to Ubuntu Linux. Successfully installed Python 3.1.1 in the Ubuntu 9.04 release on my desktop. Problem is the python interactive terminal >>> . Many of the keys now do not work. eg pressing left-arrow yields ^[[D right-arrow ^[[C

Re: Exception as the primary error handling mechanism?

2010-01-06 Thread r0g
Ben Finney wrote: > r0g writes: > >> NO! It's a rude way to start a sentence don't you think? > > Shouting is usually rude, yes. > >> Just because you're correcting someone doesn't mean you have to be >> combative and try and make them feel small. > > Again, you're reading something that isn't

Re: Exception as the primary error handling mechanism?

2010-01-06 Thread Michi
On Jan 5, 9:44 am, Steven D'Aprano wrote: > > I'm glad we agree on that, but I wonder why you previously emphasised > machine efficiency so much, and correctness almost not at all, in your > previous post? Uh… Because the original poster quoted one small paragraph out of a large article and that

Re: File transfer with python

2010-01-06 Thread Emile van Sebille
On 1/6/2010 10:00 AM Valentin de Pablo Fouce said... Hi there, I hope this is the rigth place, if not please, tell me which is the right dicussion place. I apologize in such case. Ok, I am trying to do a very quick application (is "home based" so is not a big deal...). My intention is to transf

Re: creating tar file and streaming it over HTTP?

2010-01-06 Thread Steve Holden
r0g wrote: > pbienst wrote: >> I would like to bundle up a number of files in a tar file and send it >> over a HTTP connection, but I would like to do this without creating >> the tar file on disk first. >> > > Stringio lets you treat a strings as a files... > > http://docs.python.org/library/str

Re: Mencoder and creating videos

2010-01-06 Thread Emile van Sebille
On 1/6/2010 12:44 PM aditya shukla said... Hello Guys, I have a multiprocessing script which downloads images from 5 urls to 5 directories(usinf multiprocess in python 2.6).The download is for 5 mins.My aim is to create a video for every minute for each directory and dump the images as the video

Re: creating tar file and streaming it over HTTP?

2010-01-06 Thread r0g
pbienst wrote: > I would like to bundle up a number of files in a tar file and send it > over a HTTP connection, but I would like to do this without creating > the tar file on disk first. > Stringio lets you treat a strings as a files... http://docs.python.org/library/stringio.html Roger. -- h

Re: File transfer with python

2010-01-06 Thread Jan Kaliszewski
Valentin de Pablo Fouce wrote: Ok, I am trying to do a very quick application (is "home based" so is not a big deal...). My intention is to transfer files from one computer to another. My intention is to be able to transfer files from one computer to another in this environment. Looking (an

Re: Exception as the primary error handling mechanism?

2010-01-06 Thread Steve Holden
Phlip wrote: > On Jan 6, 10:23 am, Lie Ryan wrote: >> On 1/7/2010 3:41 AM, Phlip wrote: >> >>> Steve Holden wrote: y'all just keep defending the approach to programming that *you* think is best. >>> Speak for yourself... >> Everyone speaks for themselves, is that a problem? > > Of cours

QDoubleValidator

2010-01-06 Thread Zabin
Hey! I am new PyQt programmer and want to restrict users to allow only numeric values into a table and lineedit boxes. I found the QDoubleValidator class but am unsure as to how to implement it. (I am a little shaky on the concept of parent and how to define them). Any help would be much appreciat

Re: please help shrink this each_with_index() implementation

2010-01-06 Thread Steven D'Aprano
On Wed, 06 Jan 2010 12:12:08 -0800, Phlip wrote: > And I, not my language, should pick and chose how to be rigorous. The > language should not make the decision for me. All languages make that decision for you by making some thing possible and other things not. The language designer, not the pro

Re: Introspection

2010-01-06 Thread Jason Scheirer
On Jan 6, 8:38 am, Steven D'Aprano wrote: > On Wed, 06 Jan 2010 06:53:40 -0800, m...@infoserv.dk wrote: > > I'm looking for a way to make a list of string literals in a class. > > > Example: > > > class A: > >    def method(self): > >        print 'A','BC' > > ExtractLiterals(A) > > ['A','BC'

Re: Exception as the primary error handling mechanism?

2010-01-06 Thread Steven D'Aprano
On Wed, 06 Jan 2010 12:39:36 -0800, Phlip wrote: > And now, if everyone will excuse me, I have to get back to writing a > unit-test-to-code ratio of 2:1. In my experience, that's about half as many unit-tests as needed for full code coverage for even a simple class. If you're trying to impress u

Re: Exception as the primary error handling mechanism?

2010-01-06 Thread Terry Reedy
On 1/6/2010 1:20 PM, Lie Ryan wrote: Python decided that the default behavior should be raising exception and sentinel have to use the dict.get() method. Simple and clear. The other possible behavior (i.e. slicing returns a sentinel while dict.get() raises an exception) is arguably just as simpl

Mencoder and creating videos

2010-01-06 Thread aditya shukla
Hello Guys, I have a multiprocessing script which downloads images from 5 urls to 5 directories(usinf multiprocess in python 2.6).The download is for 5 mins.My aim is to create a video for every minute for each directory and dump the images as the video is created. My question are , should i use *

Re: Exception as the primary error handling mechanism?

2010-01-06 Thread Phlip
On Jan 6, 10:23 am, Lie Ryan wrote: > On 1/7/2010 3:41 AM, Phlip wrote: > > > Steve Holden wrote: > > >> y'all just keep defending the approach to programming that > >> *you* think is best. > > > Speak for yourself... > > Everyone speaks for themselves, is that a problem? Of course not. I was poi

an't start a thread Pool from another thread

2010-01-06 Thread Glazner
Hi all, I hope someone can help me with this issue I see that i can't start a thread Pool from another thread, why? running python 2.6.4 windowsXP >>> import multiprocessing.dummy as threads >>> def makePool(): threads.Pool(3) >>> makePool() >>> import thread >>> thread.start_new(makePool

Re: please help shrink this each_with_index() implementation

2010-01-06 Thread Phlip
Nobody wrote: On Tue, 05 Jan 2010 19:46:01 -0800, alex23 wrote: They will tell me how to use except: (which is a good example why a program should not use exceptions for its normal control flow if at all possible). Really? Magic functions that coerce and eat errors are a better coding techniqu

The END (of PyCon early bird registration) is NEAR!

2010-01-06 Thread VanL
Today is the last day of registration for PyCon 2010 at the early bird rate. Registration at the early bird rate is still good as long as it is January 6 somewhere in the world. Register now! - https://us.pycon.org/2010/register/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Exception as the primary error handling mechanism?

2010-01-06 Thread Grant Edwards
On 2010-01-06, Lie Ryan wrote: > On 1/7/2010 3:41 AM, Phlip wrote: >> Steve Holden wrote: >> >>> y'all just keep defending the approach to programming that >>> *you* think is best. >> >> Speak for yourself... > > Everyone speaks for themselves, [...] Except for the Lorax. He speaks for the trees

Re: subprocess.Popen does not close pipe in an error case

2010-01-06 Thread Steven K. Wong
On Jan 6, 10:30 am, Nobody wrote: > I think that you should close prog1.stdout here. Otherwise, there will > be two readers on the pipe (the calling process and prog2). Even if one of > them dies, there's always the possibility that the caller might eventually > decide to read prog1.stdout itself.

Need help with multiprocessing.manager and passing the manager a multiprocessing.Connection

2010-01-06 Thread Metalone
The following code snippet is taken from the Python 2.6 multiprocessing documentation with a simple change and this change does not work. I would like to know how to make it work or something similar. I want to pass a Connection object to the MathsClass. I get the following error on Windows: Trac

Astronomy--Programs to Compute Siderial Time?

2010-01-06 Thread W. eWatson
Is there a smallish Python library of basic astronomical functions? There are a number of large such libraries that are crammed with excessive functions not needed for common calculations. -- http://mail.python.org/mailman/listinfo/python-list

Re: getfirst and re

2010-01-06 Thread Victor Subervi
On Wed, Jan 6, 2010 at 3:09 PM, Carsten Haese wrote: > Victor Subervi wrote: > > I have an automatically generated HTML form from which I need to extract > > data to the script which this form calls (to which the information is > > sent). > > Ideally, the script that receives the submitted fields

Re: getfirst and re

2010-01-06 Thread Carsten Haese
Victor Subervi wrote: > I have an automatically generated HTML form from which I need to extract > data to the script which this form calls (to which the information is > sent). Ideally, the script that receives the submitted fields should know how the form was generated, so it knows what fields t

Re: suds problem

2010-01-06 Thread Fencer
On 2010-01-06 19:33, Fencer wrote: Hello, I just started using suds to use web services. First I tried suds with a very simple web service I had written and was running myself. That worked fine. Then I tried to use the web services provided by KEGG: http://soap.genome.jp/KEGG.wsdl But I get a SAX

Re: Python books, literature etc

2010-01-06 Thread J
A good point was brought up to me privately, and I agree completely, that the OP should re-state the request with a bit more specifics... Since the OP says he is at least familiar with Python, does he need info on beginner level books that are general purpose, or is he interested in resources that

Re: File transfer with python

2010-01-06 Thread Lie Ryan
On 1/7/2010 5:00 AM, Valentin de Pablo Fouce wrote: My intention is to be able to transfer files from one computer to another in this environment. Do you have a USB flashdrive? Looking (and surfing) at internet the only suggestion given is to use low level sockets for this file transfer. Is t

Re: python xmlrpc client with ssl client certificates and standard modules

2010-01-06 Thread Heikki Toivonen
News123 wrote: > This will probably work, but it requires the module M2Crypto. > > In order to avoid installing M2Crypto an all hosts that want to run the > script I wondered, whether there is no other solution. > > I can do xmlrpc over ssl WITHOUT certificates with following code: [...] Please

Re: subprocess.Popen does not close pipe in an error case

2010-01-06 Thread Nobody
On Tue, 05 Jan 2010 15:50:39 -0800, Steven K. Wong wrote: > Below, I have a Python script that launches 2 child programs, prog1 > and prog2, with prog1's stdout connected to prog2's stdin via a pipe. > (It's like executing "prog1 | prog2" in the shell.) > > If both child programs exit with 0, the

Re: 3 byte network ordered int, How To ?

2010-01-06 Thread Matthew Barnett
mudit tuli wrote: For a single byte, struct.pack(') For two bytes, struct.pack(') what if I want three bytes ? Four bytes and then discard the most-significant byte: struct.pack(')[ : -1] -- http://mail.python.org/mailman/listinfo/python-list

Re: Exception as the primary error handling mechanism?

2010-01-06 Thread Lie Ryan
On 1/7/2010 3:41 AM, Phlip wrote: Steve Holden wrote: y'all just keep defending the approach to programming that *you* think is best. Speak for yourself... Everyone speaks for themselves, is that a problem? -- http://mail.python.org/mailman/listinfo/python-list

Re: Exception as the primary error handling mechanism?

2010-01-06 Thread Lie Ryan
On 1/7/2010 2:12 AM, Phlip wrote: On Jan 5, 10:54 pm, Benjamin Kaplan wrote: {41: None}[41] ? In cases where None is a valid result, you can't use it to signal failure.. Asked and answered. You change the "sentinel" in .fetch to something else. I believe Ben Kaplan's point is that if dict

Re: please help shrink this each_with_index() implementation

2010-01-06 Thread Nobody
On Tue, 05 Jan 2010 19:46:01 -0800, alex23 wrote: >> They will tell me how to use except: (which is a good example why a >> program should not use exceptions for its normal control flow if at >> all possible). > > Really? Magic functions that coerce and eat errors are a better coding > technique

Re: please help shrink this each_with_index() implementation

2010-01-06 Thread Carl Banks
On Jan 5, 2:40 pm, Phlip wrote: > On Jan 5, 1:10 pm, Antoine Pitrou wrote: > > >http://docs.python.org/library/functions.html > > > Don't forget that the Python documentation is rich and structured. > > And good luck. > > Does it say how to convert a string containing either an integer > represen

File transfer with python

2010-01-06 Thread Valentin de Pablo Fouce
Hi there, I hope this is the rigth place, if not please, tell me which is the right dicussion place. I apologize in such case. Ok, I am trying to do a very quick application (is "home based" so is not a big deal...). My intention is to transfer files from one computer to another. I am using seve

Re: getfirst and re

2010-01-06 Thread Victor Subervi
On Wed, Jan 6, 2010 at 1:59 PM, Tim Chase wrote: > Victor Subervi wrote: > >> On Wed, Jan 6, 2010 at 1:27 PM, Tim Chase > >wrote: >> >> But if you're using it on HTML form text, regexps are usually the wrong >>> tool, and you should be using an HTML parser (such as BeautifulSoup) that >>> knows h

3 byte network ordered int, How To ?

2010-01-06 Thread mudit tuli
For a single byte, struct.pack(') For two bytes, struct.pack(') what if I want three bytes ? -- http://mail.python.org/mailman/listinfo/python-list

Re: please help shrink this each_with_index() implementation

2010-01-06 Thread Nobody
On Tue, 05 Jan 2010 12:20:58 -0800, Marco Nawijn wrote: > You could use the build-in function enumerate inside a list > comprehension. > seq = range(5) [ (i,s) for i,s in enumerate(seq) ] > [(0, 0), (1, 1), (2, 2), (3, 3), (4, 4)] Just use list(), i.e. "list(enumerate(seq))". -- http

Re: getfirst and re

2010-01-06 Thread Tim Chase
Victor Subervi wrote: On Wed, Jan 6, 2010 at 1:27 PM, Tim Chase wrote: But if you're using it on HTML form text, regexps are usually the wrong tool, and you should be using an HTML parser (such as BeautifulSoup) that knows how to handle odd text and escapings better and more robustly than regex

Re: getfirst and re

2010-01-06 Thread Victor Subervi
On Wed, Jan 6, 2010 at 1:27 PM, Tim Chase wrote: > But if you're using it on HTML form text, regexps are usually the wrong > tool, and you should be using an HTML parser (such as BeautifulSoup) that > knows how to handle odd text and escapings better and more robustly than > regexps will. > I hav

Pass multidimensional array (matrix) to c function using ctypes

2010-01-06 Thread Daniel Platz
Hello, I would like to pass a two dimensional array to C function in a dll. I use ctypes to call the function. I compile the dll with visual studio 2008 express and my C source code looks like this. #include #ifdef __cplusplus extern "C" { // only need to export C interface if //

Re: getfirst and re

2010-01-06 Thread Tim Chase
I need to do something like the following: pat = re.compile('edit[0-9]*:[0-9]*') check = form.getfirst(pat) (to check things like 'edit0:1') How do I do this? Well, you can do it either as check = pat.search(string_to_search) which is pretty plainly detailed in the help for the "re

Python tk Listbox: -listvariable

2010-01-06 Thread Looney, James B
Yesterday, I searched all over trying to figure out how to properly use the "listvariable" argument with tk's Listbox class. Unfortunately, no amount of searching (online) could come up with anything more useful than telling me the variable needed to be a list, and nothing built-in exists. I f

getfirst and re

2010-01-06 Thread Victor Subervi
Hi; I need to do something like the following: pat = re.compile('edit[0-9]*:[0-9]*') check = form.getfirst(pat) (to check things like 'edit0:1') How do I do this? TIA, beno -- The Logos has come to bear http://logos.13gems.com/ -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >