Re: datetime.datetime. or datetime. ?

2009-10-08 Thread Carl Banks
On Oct 8, 3:11 pm, niklasr wrote: > On Oct 8, 5:25 pm, "Diez B. Roggisch" wrote: > > > > > > > NiklasRTZ schrieb: > > > > Hello, my basic question is which recommendation is after slight > > > restructuring datetime.datetime to datetime > > > Both works but only one should be chosen probably adju

Re: Is there a better way to code variable number of return arguments?

2009-10-08 Thread Phillip M. Feldman
This is an interesting alternative. If one wants to generate everything and return it at one shot, the list approach is better, but there are situations where generating things incrementally is preferrable, e.g., because the caller doesn't know a priori how many things he wants. I will try th

Re: Is there a better way to code variable number of return arguments?

2009-10-08 Thread Robert Kern
Dr. Phillip M. Feldman wrote: I'm amazed that this works. I had not realized that x,y= [3,4] is equivalent to x= 3; y= 4 Python is rather clever. Thanks! To elaborate on Paul's answer, returning the list will also unpack it if you have it set up that way. E.g. def func(alist): re

Re: Is there a better way to code variable number of return arguments?

2009-10-08 Thread Alan G Isaac
Dr. Phillip M. Feldman writes: I currently have a function that uses a list internally but then returns the list items as separate return values as follows: if len(result)==1: return result[0] if len(result)==2: return result[0], result[1] (and so on). Is there a cleaner way to accomplish the

Re: Is there a better way to code variable number of return arguments?

2009-10-08 Thread Simon Forman
On Thu, Oct 8, 2009 at 7:14 PM, Dr. Phillip M. Feldman wrote: > > I'm amazed that this works.  I had not realized that > > x,y= [3,4] > > is equivalent to > > x= 3; y= 4 > > Python is rather clever. > > Thanks! > Python is very clever: >>> (a, b), c = (1, 2), 3 >>> a, b, c (1, 2, 3) :D -- http

Persistent Distributed Objects

2009-10-08 Thread John Haggerty
I am interested in seeing how it would be possible in python to have persistent objects (basically be able to save objects midway through a computation, etc) and do so across multiple computers. Something that would allow for memory, disk space, processing power, etc to be distributed across the n

web sound recording with python

2009-10-08 Thread kernus
I need a web-based sound recording application and upload the sound data to a web server (python cgi?). the project is web voice search, so the web cgi would be a voice search server. any idea about the whole solution(web page and the python cgi)? thanks -- http://mail.python.org/mailman/listinf

Re: Is there a better way to code variable number of return arguments?

2009-10-08 Thread Hendrik van Rooyen
On Thursday, 8 October 2009 18:41:31 Dr. Phillip M. Feldman wrote: > I currently have a function that uses a list internally but then returns > the list items as separate return > values as follows: > > if len(result)==1: return result[0] > if len(result)==2: return result[0], result[1] > > (and so

<    1   2