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

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

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

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

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 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 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: 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: Sentiment analysis using Python

2009-10-08 Thread alex23
On Oct 9, 10:26 am, Henrik Lied wrote: > An experiment I'm currently involved with requires some form of texual > analysis to figure out the "mood" of sentences (ergo, if the sentence > in any way seem negative or positive). I vaguely recall seeing a presentation on exactly this at an open source

Re: python3.1 shell and Arrow Keys ?

2009-10-08 Thread Peter Billam
On 2009-10-08, casevh wrote: > On Oct 8, 2:47 pm, Peter Billam wrote: >> Greetings.  I've upgraded 3.0->3.1 and now my arrow-keys don't >> work at the shell command-line, I just get: >>   >>> ^[[A >> etc. Is there some environment-variable or option I have to set ? >> I'm using xterm on debian le

Re: datetime.datetime. or datetime. ?

2009-10-08 Thread Gabriel Genellina
En Thu, 08 Oct 2009 19:11:04 -0300, niklasr escribió: 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 - how to import is mostly a matter of taste, as long as

Re: Sentiment analysis using Python

2009-10-08 Thread Paul Rubin
Henrik Lied writes: > Do any of you have experience with something equivalent, and perhaps > some pointers on where I should go forward? en.wikipedia.org/wiki/Latent_semantic_analysis perhaps. -- http://mail.python.org/mailman/listinfo/python-list

Sentiment analysis using Python

2009-10-08 Thread Henrik Lied
Hi there, An experiment I'm currently involved with requires some form of texual analysis to figure out the "mood" of sentences (ergo, if the sentence in any way seem negative or positive). Do any of you have experience with something equivalent, and perhaps some pointers on where I should go for

Re: python3.1 shell and Arrow Keys ?

2009-10-08 Thread casevh
On Oct 8, 2:47 pm, Peter Billam wrote: > Greetings.  I've upgraded 3.0->3.1 and now my arrow-keys don't work > at the shell command-line, I just get: >   >>> ^[[A > etc. Is there some environment-variable or option I have to set ? > I'm using xterm on debian lenny, and compiled python3.1.1, as far

Re: datetime.datetime. or datetime. ?

2009-10-08 Thread Diez B. Roggisch
niklasr schrieb: 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 adjust my package to comply to dependencies. Spec int

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

2009-10-08 Thread Dr. Phillip M. Feldman
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): return alist some_list = [1, 2] t

Re: datetime.datetime. or datetime. ?

2009-10-08 Thread niklasr
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 adjust my package to > > comply to dependencies. > > Spec i

Re: Reading hex to int from a binary string

2009-10-08 Thread Luc
On Oct 8, 11:13 pm, "Diez B. Roggisch" wrote: > Luc schrieb: > > > Hi all, > > > I read data from a binary stream, so I get hex values as characters > > (in a string) with escaped x, like "\x05\x88", instead of 0x05. > > > I am looking for a clean way to add these two values and turn them > > into

python3.1 shell and Arrow Keys ?

2009-10-08 Thread Peter Billam
Greetings. I've upgraded 3.0->3.1 and now my arrow-keys don't work at the shell command-line, I just get: >>> ^[[A etc. Is there some environment-variable or option I have to set ? I'm using xterm on debian lenny, and compiled python3.1.1, as far as I remember, just with sh configure, make, make

Re: mktime, how to handle dates before 01-01-1970 ?

2009-10-08 Thread John Yeung
On Oct 6, 4:10 pm, Stef Mientki wrote: > > thanks guys, > mx works a bit better   Another popular Python date library is dateutil: http://labix.org/python-dateutil It gives a certain amount of credit to mxDateTime (praising it but not being very clear how they are related; there is some m

Re: datetime.datetime. or datetime. ?

2009-10-08 Thread Diez B. Roggisch
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 adjust my package to comply to dependencies. Spec integrated code where datetime.datetime.now() refactored to datetime.

datetime.datetime. or datetime. ?

2009-10-08 Thread NiklasRTZ
Hello, my basic question is which recommendation is after slight restructuring datetime.datetime to datetime Both works but only one should be chosen probably adjust my package to comply to dependencies. Spec integrated code where datetime.datetime.now() refactored to datetime.now() set rather from

Re: Reading hex to int from a binary string

2009-10-08 Thread Diez B. Roggisch
Luc schrieb: Hi all, I read data from a binary stream, so I get hex values as characters (in a string) with escaped x, like "\x05\x88", instead of 0x05. I am looking for a clean way to add these two values and turn them into an integer, knowing that calling int() with base 16 throws an invalid

Re: trouble with regex?

2009-10-08 Thread Paul McGuire
On Oct 8, 11:42 am, MRAB wrote: > inhahe wrote: > > Can someone tell me why this doesn't work? > > > colorre = re.compile ('(' > >                         '^' > >                        '|' > >                         '(?:' > >                            '\x0b(?:10|11|12|13|14|15|0\\d|\\d)' > >  

Re: Multiprocessing.Array bug / shared numpy array

2009-10-08 Thread Robert Kern
On 2009-10-08 15:14 PM, Felix wrote: I am trying to create a shared, read-only numpy.ndarray between several processes. After some googling the basic idea is: sarr = mp.Array('i',1000) ndarr = scipy.frombuffer(sarr._obj,dtype='int32') Since it will be read only (after being filled once in a si

Re: mktime, how to handle dates before 01-01-1970 ?

2009-10-08 Thread John Yeung
On Oct 6, 5:11 pm, Christian Heimes wrote: > Ben Finney wrote: > > If you're committed to changing the epoch anyway, I would recommend > > using http://en.wikipedia.org/wiki/Astronomical_year_numbering> > > (epoch at 4004 BCE) since it is widely used to unify dates referring to > > human history.

Re: Unofficial Python GIS SIG

2009-10-08 Thread Aahz
In article <07bd0443-5e60-4661-b03d-1db1b5de6...@k4g2000yqb.googlegroups.com>, seang wrote: >On Oct 1, 9:49=A0pm, a...@pythoncraft.com (Aahz) wrote: >> >> Any particular reason you didn't create a list @python.org? > >Only that I am not entirely sure this will take off and don't want to >leave p

Re: Cashing in PythonWin name space?... seems unexpected to me

2009-10-08 Thread w.g.sned...@gmail.com
On Oct 8, 2:12 pm, Dave Angel wrote: > bsneddon wrote: > > I saw an issue  on winXP  box not connected to internet yesterday, > > where i was running > > a script in the interactive window on PythonWin .   I would modify the > > script save and > > import and was still running the old version.  I

Re: del an imported Class at EOF... why?

2009-10-08 Thread Terry Reedy
Terry Reedy wrote: Hans Mulder wrote: Errrhm, no. He is not deleting the PyQt4 module from sys.modules; he's only deleting the name QtGui from his own namespace. Next time Python comes across from PyQt4 import QtGui , it finds that the module PyQt4 already exists in sys.modules, so Pyth

extract oracle-BLOBs to the file system (9.2.0.7): some docs not readable

2009-10-08 Thread Mark Dellon
Dear colleges, I read BLOBs from oracle database and write these in a loop to a the file system. Some documents (e.g.PDF) are not correct and I can't open these. Database size of these blobs is different to size on the file system. Which code I should use for readig blob from oracle database?

Multiprocessing.Array bug / shared numpy array

2009-10-08 Thread Felix
Hi, The documentation for the Multiprocessing.Array says: multiprocessing.Array(typecode_or_type, size_or_initializer, *, lock=True)¶ ... If lock is False then access to the returned object will not be automatically protected by a lock, so it will not necessarily be “process-safe”. ... However:

Re: del an imported Class at EOF... why?

2009-10-08 Thread Terry Reedy
Simon Forman wrote: On Thu, Oct 8, 2009 at 1:42 AM, Terry Reedy wrote: Hans Mulder wrote: Errrhm, no. He is not deleting the PyQt4 module from sys.modules; he's only deleting the name QtGui from his own namespace. Next time Python comes across from PyQt4 import QtGui , it finds that th

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

2009-10-08 Thread Jack Norton
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 on). Is there a cleaner way to accomplish the s

Re: windows side-by-side configuration woes on windows HPC

2009-10-08 Thread M.-A. Lemburg
Nick Touran wrote: > Copying my local copy of Python 2.6 to a Windows HPC 2008 system is giving > dll side-by-side configuration errors for some third-party packages > (matplotlib, pyMSSQL, in particular). I understand that there is a tradition > of Python supporting XCOPY deployment, and would rea

Re: mktime, how to handle dates before 01-01-1970 ?

2009-10-08 Thread Stef Mientki
Stephen Hansen wrote: Personally, while /users/ may write a date in a lazy way like "01-01-53", I'd never store that and would avoid having them enter them directly. At the UI level I'd validate and normalize it to a standard format before storing it. yes I agree, but the data is coming fr

Re: Is pythonic version of scanf() or sscanf() planned?

2009-10-08 Thread Terry Reedy
ryniek90 wrote: On 6 Paź, 06:37, Dennis Lee Bieber wrote: On Sun, 4 Oct 2009 15:48:16 -0700 (PDT), TerryP declaimed the following in gmane.comp.python.general: In the last 4 years, I have never missed functions like .*scanf() or atoi(). It's probably a greeaaat thing that Python provides net

Re: Multiprocessing.Queue deadlock

2009-10-08 Thread Felix Schlesinger
On Oct 8, 3:21 am, Dennis Lee Bieber wrote: > On Wed, 7 Oct 2009 10:24:08 -0700 (PDT), Felix Schlesinger > > A bunch of workers push an unknown number of results into a queue. The > > main process needs to collect all those results. > > > What is the right way to implement that with multiprocessin

Re: A new Internet-search website written in Python

2009-10-08 Thread Aahz
In article <7xocor1pii@ruckus.brouhaha.com>, Paul Rubin wrote: >"hrg...@gmail.com" writes: >> >> The purpose of this email is to inform the Python-list mailing-list >> subscribers of an Internet-search website that is run by software >> written in Python. > >Is

Re: sftp login without password

2009-10-08 Thread David
Il Tue, 06 Oct 2009 12:26:34 -0800, Joshua Kugler ha scritto: > David wrote: >> transport.connect(username = username, pkey = mykey) >> >> I get a "AuthenticationException: Authentication failed." exception. >> >> >> My ~/.ssh/id_rsa is correct because if, at console, I type >> >> bags...@bagv

Re: load_dynamic(_name_, path)

2009-10-08 Thread MRAB
jim-on-linux wrote: Python help, In win32api line 10 is written: mod = imp.load_dynamic(__name__, path) traceback; ImportError: DLL load failed: The specified module could not be found. import imp is available, Where does load_dynamic(__name__, path) come from? The traceback is saying

Re: Neural networks in python

2009-10-08 Thread ruchir
On Oct 8, 1:21 pm, Raymond Hettinger wrote: > On Oct 7, 10:53 pm, ruchir wrote: > > > I want to design and train a neural network in python. Can anyone > > guide me, from where can I get some useful material/eBook/libraries > > etc. for the same. I have no prior experience in neural netwoks and >

Re: Cashing in PythonWin name space?... seems unexpected to me

2009-10-08 Thread Dave Angel
bsneddon wrote: I saw an issue on winXP box not connected to internet yesterday, where i was running a script in the interactive window on PythonWin . I would modify the script save and import and was still running the old version. I did that several times with same result. I even renamed th

Re: Problem Displaying Pics

2009-10-08 Thread Victor Subervi
I have come to the conclusion that this has absolutely nothing to do with the code. The problem is eNom. I have had so many problems with this provider specifically concerning their python interpreter that I actually filed a complaint against them with the BBB, which they still didn't resolve. Now

Re: best vi / emacs python features

2009-10-08 Thread TerryP
> But in actual practice you use a space cadets editor like Vim. > >                                         Ross Ridge Actually by space cadets editor, I meant needing one of these: http://en.wikipedia.org/wiki/Space_cadet_keyboard -- TerryP. -- http://mail.python.org/mailman/listinfo/python-li

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

2009-10-08 Thread Ethan Furman
Paul Rubin wrote: Ethan Furman writes: some_list = [1, 2] this, that = func(alist) At least, in 2.5.4 this works. :-) But that fails if there are fewer than two elements in the list. It's better to just make the logic either expect a list, or if it's implementing something like an option

load_dynamic(_name_, path)

2009-10-08 Thread jim-on-linux
Python help, In win32api line 10 is written: mod = imp.load_dynamic(__name__, path) traceback; ImportError: DLL load failed: The specified module could not be found. import imp is available, Where does load_dynamic(__name__, path) come from? jim-on-linux -- http://mail.python.org/mailman/

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

2009-10-08 Thread Paul Rubin
Ethan Furman writes: > some_list = [1, 2] > this, that = func(alist) > > At least, in 2.5.4 this works. :-) But that fails if there are fewer than two elements in the list. It's better to just make the logic either expect a list, or if it's implementing something like an optional value, code i

Re: Is pythonic version of scanf() or sscanf() planned?

2009-10-08 Thread Simon Brunning
2009/10/8 ryniek90 : > Ok thanks all for answers. Not counting .split() methods and regexps, > there's nothing interesting. > But I remember that lambda function also was unwelcome in Python, but > finally it is and is doing well. So maybe someone, someday decide to > put in Python an alternative,

Re: How to run python script in emacs

2009-10-08 Thread Chris
> if you want, i can suggest you some lines for the init file .emacs, > in order to keep the text indented with 4 spaces, no tab at all (very > important). I would be interest in the .emacs changes for python mode. -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter -- the best way to make a realtime loop

2009-10-08 Thread J Wolfe
Thank you both for your replies. I had something similar to this: def incr(): var.set(1 + var.get()) root.after(1000, incr) except I had an extra set of parenthesis... def incr(): var.set(1 + var.get()) root.after(1000, incr()) on the function which was screwing it up. Also needed to ha

Re: threading module, call thread.interrupt_main()

2009-10-08 Thread Gabriel Genellina
En Thu, 08 Oct 2009 00:33:04 -0300, §äŽmŠÛ€vªº...@€ù€Ñ escribió: Sorry to ask, but i don't know how to solve it. No need to apologize! I try to call thread.interrupt_main() function in my child thread's run method which is inherit threading.Thread class. But it didn't w

Re: threading module, call thread.interrupt_main()

2009-10-08 Thread Gabriel Genellina
En Thu, 08 Oct 2009 00:33:04 -0300, §äŽmŠÛ€vªº...@€ù€Ñ escribió: Sorry to ask, but i don't know how to solve it. No need to apologize! I try to call thread.interrupt_main() function in my child thread's run method which is inherit threading.Thread class. But it didn't w

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

2009-10-08 Thread Ethan Furman
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 on). Is there a cleaner way to accomplish the s

windows side-by-side configuration woes on windows HPC

2009-10-08 Thread Nick Touran
Copying my local copy of Python 2.6 to a Windows HPC 2008 system is giving dll side-by-side configuration errors for some third-party packages (matplotlib, pyMSSQL, in particular). I understand that there is a tradition of Python supporting XCOPY deployment, and would really like to be able to just

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 12:41 PM, 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

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

2009-10-08 Thread Jean-Michel Pichavant
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 on). Is there a cleaner way to accomplish the s

Re: best vi / emacs python features

2009-10-08 Thread Ross Ridge
TerryP wrote: >ed -- I can quickly edit files without having to wait on an ncurses >app to start up. Although I rarely have access to GNU versions of ed, >they use readline which is a big perk when you make a typo. I used to fallback on ed when network connections got really slow and I could log

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

2009-10-08 Thread Christian Heimes
Dr. Phillip M. Feldman schrieb: > 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

Re: Cashing in PythonWin name space?... seems unexpected to me

2009-10-08 Thread Simon Forman
On Thu, Oct 8, 2009 at 9:47 AM, bsneddon wrote: > I saw an issue  on winXP  box not connected to internet yesterday, > where i was running > a script in the interactive window on PythonWin .   I would modify the > script save and > import and was still running the old version.  I did that several

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

2009-10-08 Thread Paul Rubin
"Dr. Phillip M. Feldman" writes: > 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 same thing? That is poor style. Just return the result as a list. -- http://mail.python.org/mailman/listinfo/python

Re: Problem Displaying Pics

2009-10-08 Thread Gabriel Genellina
En Thu, 08 Oct 2009 12:30:16 -0300, Victor Subervi escribió: http://13gems.com/stxresort/cart/getpic1.py?id=1&x=1 On Wed, Oct 7, 2009 at 4:11 PM, Rami Chowdhury wrote: On Wed, 07 Oct 2009 14:05:25 -0700, Victor Subervi < victorsube...@gmail.com> wrote: print 'Content-Type: image/jpeg'

Re: trouble with regex?

2009-10-08 Thread MRAB
inhahe wrote: Can someone tell me why this doesn't work? colorre = re.compile ('(' '^' '|' '(?:' '\x0b(?:10|11|12|13|14|15|0\\d|\\d)' '(?:' '

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

2009-10-08 Thread Dr. Phillip M. Feldman
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 same thing? -- View this messag

Re: threading module, call thread.interrupt_main()

2009-10-08 Thread Simon Forman
2009/10/7 找尋自己的一片天 : > Sorry to ask, but i don't know how to solve it. > > I try to call thread.interrupt_main() function in my child thread's run method > which is inherit threading.Thread class. > > But it didn't work, does anyone know why? > > Thanks a lot!! > "it didn't work" i

Re: del an imported Class at EOF... why?

2009-10-08 Thread Simon Forman
On Thu, Oct 8, 2009 at 1:42 AM, Terry Reedy wrote: > Hans Mulder wrote: > >> Errrhm, no.  He is not deleting the PyQt4 module from sys.modules; >> he's only deleting the name QtGui from his own namespace.  Next >> time Python comes across >> >>    from PyQt4 import QtGui >> >> , it finds that the

Re: Is pythonic version of scanf() or sscanf() planned?

2009-10-08 Thread Ben Sizer
On Oct 3, 11:06 pm, ryniek90 wrote: > Hi > > I know that in python, we can do the same with regexps or *.split()*, > but thats longer and less practical method than *scanf()*. I also found > that (http://code.activestate.com/recipes/502213/), but the code > doesn't looks so simple for beginners. S

trouble with regex?

2009-10-08 Thread inhahe
Can someone tell me why this doesn't work? colorre = re.compile ('(' '^' '|' '(?:' '\x0b(?:10|11|12|13|14|15|0\\d|\\d)' '(?:' ',(?:10|11|12|13|1

transparent splash screen

2009-10-08 Thread NighterNet
I been looking for simple way to create a transparent splash screen. Using gif,png,jpg just by loading the file into it. Using version 3.1.1 Any help would be nice. -- http://mail.python.org/mailman/listinfo/python-list

ANN: Testoob 1.15 released

2009-10-08 Thread oripel
Testoob is the advanced Python test runner and testing framework that spices up any existing unittest test suite. Home: http://code.google.com/p/testoob Version 1.15 (Oct. 2009) adds better Python 2.6, IronPython, and Jython support, as well as test coverage improvements, better color support, an

Re: best vi / emacs python features

2009-10-08 Thread Falcolas
On Oct 8, 7:23 am, Jean-Michel Pichavant wrote: > Chris Jones wrote: > > On Wed, Oct 07, 2009 at 07:06:08PM EDT, TerryP wrote: > > > [..] > > >> I am a freak: I do not use nor want syntax highlighting. I don't want > >> my editor to understand mail, irc, or the www either, I want it to > >> edit t

Nested Menus

2009-10-08 Thread Victor Subervi
Hi; I have the following code: sql = 'create table if not exists categories (ID int(3) unsigned primary key, Category varchar(40), Parent varchar(40))' cursor.execute(sql) cursor.execute('select Category, Parent from categories;') data = cursor.fetchall() parents = [] Parents = [] for

Re: No threading.start_new_thread(), useful addition?

2009-10-08 Thread Christian Heimes
Ulrich Eckhardt wrote: > No, as this one doesn't give me a handle to the thread. I also find this > barely readable, for sure it doesn't beat the readability of the proposed > function. Roll your own convenient function, though. :) At work we have this short function in our tool box: def daemonth

Re: best vi / emacs python features

2009-10-08 Thread edexter
On Oct 7, 10:07 am, OdarR wrote: > hello, > > * this is not a troll * > > which kind of help you have with your favorite editor ? > > personnally, I find emacs very nice, in the current state of my > knowledge, when I need to reindent the code. > you know how this is critical in python...:-) > > I

Re: No threading.start_new_thread(), useful addition?

2009-10-08 Thread Christian Heimes
Hendrik van Rooyen wrote: > What does the Threading module buy me, other than a formal OO approach? * the interpreter won't know about your thread when you bypass the threading module and use the thread module directly. The thread isn't in the list of active threads and the interpreter is unable t

Re: Problem Displaying Pics

2009-10-08 Thread Victor Subervi
http://13gems.com/stxresort/cart/getpic1.py?id=1&x=1 TIA, V On Wed, Oct 7, 2009 at 4:11 PM, Rami Chowdhury wrote: > On Wed, 07 Oct 2009 14:05:25 -0700, Victor Subervi < > victorsube...@gmail.com> wrote: > > print 'Content-Type: image/jpeg' >> print 'Content-Encoding: base64' >> print >> print co

Re: No threading.start_new_thread(), useful addition?

2009-10-08 Thread Hendrik van Rooyen
On Thursday, 8 October 2009 13:24:14 Christian Heimes wrote: > Laszlo Nagy wrote: > > But really thread.start_new_thread is better: > > > > import thread.start_new_thread as thr > > > > thr(my_function,arg1,arg2) > > Please don't use the thread module directly, especially the > start_new_thread fun

Re: Is pythonic version of scanf() or sscanf() planned?

2009-10-08 Thread ryniek90
On 6 Paź, 06:37, Dennis Lee Bieber wrote: > On Sun, 4 Oct 2009 15:48:16 -0700 (PDT), TerryP > declaimed the following in gmane.comp.python.general: > > > In the last 4 years, I have never missed functions like .*scanf() or > > atoi(). > > > It's probably a greeaaat thing that Python provides neth

Re: Python + webservice

2009-10-08 Thread Fred Chevitarese
Hello again!! Now i'm reading the documentation... If i got doubts, i ask here! Thanks ;) On Oct 8, 10:50 am, Fred Chevitarese wrote: > First of all, thanks for these replies... > Someone has an example of python + suds generating a XML and consuming > a webservice or, in suds documentation ha

Re: Python + webservice

2009-10-08 Thread Fred Chevitarese
First of all, thanks for these replies... Someone has an example of python + suds generating a XML and consuming a webservice or, in suds documentation has one? Thanks again ;) On Oct 8, 8:32 am, Jakob Kristensen wrote: > Ralf Schoenian wrote: > > > Has anyone made something like this and can

Cashing in PythonWin name space?... seems unexpected to me

2009-10-08 Thread bsneddon
I saw an issue on winXP box not connected to internet yesterday, where i was running a script in the interactive window on PythonWin . I would modify the script save and import and was still running the old version. I did that several times with same result. I even renamed the function and it

Re: cpython compilation parameter

2009-10-08 Thread Diez B. Roggisch
cEd wrote: > Hello, > > I'm wondering how to compile python to get good performance. > Because when I compare this ugly code which find prime number: > > # prime_number.py > start=3 > for is_first in range(start): > found = 0 > is_first+=1 > for i in range (2, is_first): > if not (is_fi

cpython compilation parameter

2009-10-08 Thread cEd
Hello, I'm wondering how to compile python to get good performance. Because when I compare this ugly code which find prime number: # prime_number.py start=3 for is_first in range(start): found = 0 is_first+=1 for i in range (2, is_first): if not (is_first%(i)): found = 1 break if

Re: When ‘super’ is not a good id ea

2009-10-08 Thread Jean-Michel Pichavant
alex23 wrote: Jean-Michel Pichavant wrote: alex23 wrote: To me, the explicit reference to the base class violates DRY. It also means you need to manually change all such references should the base class ever change, something that using super() avoids. I found the correct answe

Re: best vi / emacs python features

2009-10-08 Thread Jean-Michel Pichavant
Chris Jones wrote: On Wed, Oct 07, 2009 at 07:06:08PM EDT, TerryP wrote: [..] I am a freak: I do not use nor want syntax highlighting. I don't want my editor to understand mail, irc, or the www either, I want it to edit text efficiently so I can go on with the rest of my life as soon as pos

Re: No threading.start_new_thread(), useful addition?

2009-10-08 Thread Ulrich Eckhardt
Laszlo Nagy wrote: > Ulrich Eckhardt írta: >> Hi! >> >> I'm looking at the 'threading' module and see that other than the >> 'thread' module it doesn't have a simple function to start a new thread. >> Instead, you first have to instantiate a threading object and then start >> the new thread on it:

Re: No threading.start_new_thread(), useful addition?

2009-10-08 Thread Ulrich Eckhardt
sturlamolden wrote: > On 8 Okt, 09:17, Ulrich Eckhardt wrote: > >> I'm looking at the 'threading' module and see that other than the >> 'thread' module it doesn't have a simple function to start a new thread. >> Instead, you first have to instantiate a threading object and then start >> the new t

Re: Python + webservice

2009-10-08 Thread Jakob Kristensen
Ralf Schoenian wrote: > > Has anyone made something like this and can share with me a bit of > > experience? > > Did you try sudshttps://fedorahosted.org/suds? I've got good results > with this library. > > Ralf After working with both ZSI and Suds, i must say i've had by far the best experiences

Re: No threading.start_new_thread(), useful addition?

2009-10-08 Thread Christian Heimes
Laszlo Nagy wrote: > But really thread.start_new_thread is better: > > import thread.start_new_thread as thr > > thr(my_function,arg1,arg2) Please don't use the thread module directly, especially the start_new_thread function. It a low level function that bypasses the threading framework. The is

Re: No threading.start_new_thread(), useful addition?

2009-10-08 Thread sturlamolden
On 8 Okt, 09:17, Ulrich Eckhardt wrote: > I'm looking at the 'threading' module and see that other than the 'thread' > module it doesn't have a simple function to start a new thread. Instead, > you first have to instantiate a threading object and then start the new > thread on it: > >   t = threa

Re: No threading.start_new_thread(), useful addition?

2009-10-08 Thread Laszlo Nagy
Ulrich Eckhardt írta: Hi! I'm looking at the 'threading' module and see that other than the 'thread' module it doesn't have a simple function to start a new thread. Instead, you first have to instantiate a threading object and then start the new thread on it: t = threading.Thread(target=my_fu

Re: data matrix python

2009-10-08 Thread lallous
Hello Try re-asking your question in a more general way so that users w/o background information (about those classes and modules you're using) can help you with your problem. -- Elias wrote in message news:mailman.968.1254922056.2807.python-l...@python.org... Good morning all! I am tryin

Re: .pyc from stdin?

2009-10-08 Thread lallous
Hello Shay, "Shay Telfer" wrote in message news:mailman.1021.1254988413.2807.python-l...@python.org... Hi... It seems that python will accept a .py file piped from stdin, but not a .pyc file (and there don't seem to be any flags to allow this). Am I missing something? Eg cat blah.py | py

Re: .pyc from stdin?

2009-10-08 Thread lallous
Hello Shay, "Shay Telfer" wrote in message news:mailman.1021.1254988413.2807.python-l...@python.org... Hi... It seems that python will accept a .py file piped from stdin, but not a .pyc file (and there don't seem to be any flags to allow this). Am I missing something? Eg cat blah.py | py

Re: .pyc from stdin?

2009-10-08 Thread lallous
Hello Shay, "Shay Telfer" wrote in message news:mailman.1021.1254988413.2807.python-l...@python.org... Hi... It seems that python will accept a .py file piped from stdin, but not a .pyc file (and there don't seem to be any flags to allow this). Am I missing something? Eg cat blah.py | py

Re: WMI remote call in python script to create process on remote windows computer

2009-10-08 Thread Tim Golden
Processor-Dev1l wrote: On Oct 8, 10:22 am, Tim Golden wrote: David Jackson wrote: ok, cut and pasted, but changed the username/password to protect the innocent. this is from interactive prompt. let me know if i am still not doing the slashes correctly please. i doubt authentication is the issu

Re: WMI remote call in python script to create process on remote windows computer

2009-10-08 Thread Processor-Dev1l
On Oct 8, 10:22 am, Tim Golden wrote: > David Jackson wrote: > > ok, cut and pasted, but changed the username/password to protect the > > innocent. > > this is from interactive prompt. > > let me know if i am still not doing the slashes correctly please. > > i doubt authentication is the issue.;

Re: Multi-arrays python

2009-10-08 Thread Chris Rebert
On Wed, Oct 7, 2009 at 10:21 AM, wrote: > Hi again! > > After testing the whole day, I have got my goals from the last email, but as > always, another issues came up! and now that Ive been able to save a list of > list (or multi-arrays) as below : > > ['100.mp3\n' '10008.mp3\n' '10005.mp3\n' '100

Re: Neural networks in python

2009-10-08 Thread Raymond Hettinger
On Oct 7, 10:53 pm, ruchir wrote: > I want to design and train a neural network in python. Can anyone > guide me, from where can I get some useful material/eBook/libraries > etc. for the same. I have no prior experience in neural netwoks and > want to implement it urgently. > Thanks in advance :)

Re: WMI remote call in python script to create process on remote windows computer

2009-10-08 Thread Tim Golden
David Jackson wrote: ok, cut and pasted, but changed the username/password to protect the innocent. this is from interactive prompt. let me know if i am still not doing the slashes correctly please. i doubt authentication is the issue.; i can get pid information using WQL queries. objCreateProc.C

Re: Enormous Input and Output Test

2009-10-08 Thread n00m
N00m The Instigator... hahaha :-) I always wish I was a producer, an entertainer, an impressario, or even a souteneur (kidding). Life is complex: it has both real and imaginary parts. Some producer (Mr. Gomelsky) nicknamed Eric Clapton as "Slow Hand", many years ago. Gomel is my native town and ap

  1   2   >