Testoob 1.15 released

2009-10-08 Thread orip
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,

Re: Neural networks in python

2009-10-08 Thread Brian J Mingus
Machine Learning: An Algorithmic Perspective http://www.crcpress.com/product/isbn/9781420067187 Associated python code: http://seat.massey.ac.nz/personal/s.r.marsland/MLBook.html On Wed, Oct 7, 2009 at 11:53 PM, ruchir ruchir.haj...@gmail.com wrote: I want to design and train a neural network

Re: How to run python script in emacs

2009-10-08 Thread OdarR
On 7 oct, 22:07, Sells, Fred fred.se...@adventistcare.org wrote: Hitting ctrl-c, twice quickly works for me. ? what do you mean ? Olivier -- http://mail.python.org/mailman/listinfo/python-list

No threading.start_new_thread(), useful addition?

2009-10-08 Thread Ulrich Eckhardt
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_function) t.start()

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

2009-10-08 Thread eb303
On Oct 8, 12:40 am, J Wolfe vorticitywo...@gmail.com wrote: What's the best way to make a realtime loop in Tkinter? I know in perl you can use repeat and it will call a function every x seconds, in python it seems like after may be the equivalent though it doesn't seem to behave like the perl

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

2009-10-08 Thread Hendrik van Rooyen
On Thursday, 8 October 2009 00:40:42 J Wolfe wrote: What's the best way to make a realtime loop in Tkinter? I know in perl you can use repeat and it will call a function every x seconds, in python it seems like after may be the equivalent though it doesn't seem to behave like the perl repeat

.pyc from stdin?

2009-10-08 Thread Shay Telfer
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 | python works, but cat blah.pyc | python doesn't. (If you're wondering why anyone would do this it's

Multi-arrays python

2009-10-08 Thread bbarbero
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' '10001.mp3\n' '10006.mp3\n'] ['10001.mp3\n'

threading module, call thread.interrupt_main()

2009-10-08 Thread ���m�ۤv...@����
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!! -- ※Post by command from

Re: Enormous Input and Output Test

2009-10-08 Thread n00m
numerix's solution was excelled by Steve C's one (8.78s): http://www.spoj.pl/ranks/INOUTEST/lang=PYTH I don't understand nothing. -- http://mail.python.org/mailman/listinfo/python-list

Re: Enormous Input and Output Test

2009-10-08 Thread n00m
Congrats, Irmen. PS so I think 7.5 seconds for the fastest ... It's becoming crazy :-) -- http://mail.python.org/mailman/listinfo/python-list

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

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.

Re: Neural networks in python

2009-10-08 Thread Raymond Hettinger
On Oct 7, 10:53 pm, ruchir ruchir.haj...@gmail.com 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.

Re: Multi-arrays python

2009-10-08 Thread Chris Rebert
On Wed, Oct 7, 2009 at 10:21 AM, bbarb...@inescporto.pt 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'

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 m...@timgolden.me.uk 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

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 m...@timgolden.me.uk 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

Re: .pyc from stdin?

2009-10-08 Thread lallous
Hello Shay, Shay Telfer shaypyt...@earthyself.com 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

Re: .pyc from stdin?

2009-10-08 Thread lallous
Hello Shay, Shay Telfer shaypyt...@earthyself.com 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

Re: .pyc from stdin?

2009-10-08 Thread lallous
Hello Shay, Shay Telfer shaypyt...@earthyself.com 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

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 bbarb...@inescporto.pt wrote in message news:mailman.968.1254922056.2807.python-l...@python.org... Good

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 =

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

2009-10-08 Thread sturlamolden
On 8 Okt, 09:17, Ulrich Eckhardt eckha...@satorlaser.com 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

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 no

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 with

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

2009-10-08 Thread Ulrich Eckhardt
sturlamolden wrote: On 8 Okt, 09:17, Ulrich Eckhardt eckha...@satorlaser.com 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

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: t =

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

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

2009-10-08 Thread Jean-Michel Pichavant
alex23 wrote: Jean-Michel Pichavant jeanmic...@sequans.com 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

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: 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_first%(i)):

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: 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 j4k...@gmail.com wrote: Ralf Schoenian wrote: Has anyone made something like

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 fchevitar...@gmail.com wrote: First of all, thanks for these replies... Someone has an example of python + suds generating a XML and consuming a webservice or, in

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

2009-10-08 Thread ryniek90
On 6 Paź, 06:37, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On Sun, 4 Oct 2009 15:48:16 -0700 (PDT), TerryP bigboss1...@gmail.com 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

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 function. It a

Re: Problem Displaying Pics

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

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

Re: best vi / emacs python features

2009-10-08 Thread edexter
On Oct 7, 10:07 am, OdarR olivier.da...@gmail.com 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

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

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 = []

Re: best vi / emacs python features

2009-10-08 Thread Falcolas
On Oct 8, 7:23 am, Jean-Michel Pichavant jeanmic...@sequans.com 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

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,

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

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)' '(?:'

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

2009-10-08 Thread Ben Sizer
On Oct 3, 11:06 pm, ryniek90 rynie...@gmail.com 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

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: 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

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 --

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

2009-10-08 Thread Ethan Furman
Paul Rubin wrote: Ethan Furman et...@stoneleaf.us 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

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-list

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: 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

Re: Neural networks in python

2009-10-08 Thread ruchir
On Oct 8, 1:21 pm, Raymond Hettinger pyt...@rcn.com wrote: On Oct 7, 10:53 pm, ruchir ruchir.haj...@gmail.com 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

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

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...@bagvapp:~$ sftp

Re: A new Internet-search website written in Python

2009-10-08 Thread Aahz
In article 7xocor1pii@ruckus.brouhaha.com, Paul Rubin http://phr...@nospam.invalid wrote: hrg...@gmail.com 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: Multiprocessing.Queue deadlock

2009-10-08 Thread Felix Schlesinger
On Oct 8, 3:21 am, Dennis Lee Bieber wlfr...@ix.netcom.com 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

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 wlfr...@ix.netcom.com wrote: On Sun, 4 Oct 2009 15:48:16 -0700 (PDT), TerryP bigboss1...@gmail.com declaimed the following in gmane.comp.python.general: In the last 4 years, I have never missed functions like .*scanf() or atoi(). It's

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

2009-10-08 Thread Stef Mientki
Stephen Hansen wrote: snip 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

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 really

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

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 tjre...@udel.edu 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 ,

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”. ...

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?

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

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 da...@ieee.org 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.

Re: Unofficial Python GIS SIG

2009-10-08 Thread Aahz
In article 07bd0443-5e60-4661-b03d-1db1b5de6...@k4g2000yqb.googlegroups.com, seang sean.gill...@gmail.com 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

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

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

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

Re: trouble with regex?

2009-10-08 Thread Paul McGuire
On Oct 8, 11:42 am, MRAB pyt...@mrabarnett.plus.com wrote: inhahe wrote: Can someone tell me why this doesn't work? colorre = re.compile ('('                         '^'                        '|'                         '(?:'                            

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

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

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

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

2009-10-08 Thread John Yeung
On Oct 6, 4:10 pm, Stef Mientki stef.mien...@gmail.com 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

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: Reading hex to int from a binary string

2009-10-08 Thread Luc
On Oct 8, 11:13 pm, Diez B. Roggisch de...@nospam.web.de 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

Re: datetime.datetime. or datetime. ?

2009-10-08 Thread niklasr
On Oct 8, 5:25 pm, Diez B. Roggisch de...@nospam.web.de 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.

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! snip 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,

Re: datetime.datetime. or datetime. ?

2009-10-08 Thread Diez B. Roggisch
niklasr schrieb: On Oct 8, 5:25 pm, Diez B. Roggisch de...@nospam.web.de 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

Re: python3.1 shell and Arrow Keys ?

2009-10-08 Thread casevh
On Oct 8, 2:47 pm, Peter Billam pe...@www.pjb.com.au 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

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

Re: Sentiment analysis using Python

2009-10-08 Thread Paul Rubin
Henrik Lied henrikl...@gmail.com 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

Re: datetime.datetime. or datetime. ?

2009-10-08 Thread Gabriel Genellina
En Thu, 08 Oct 2009 19:11:04 -0300, niklasr nikla...@gmail.com escribió: On Oct 8, 5:25 pm, Diez B. Roggisch de...@nospam.web.de wrote: NiklasRTZ schrieb: Hello, my basic question is which recommendation is after slight restructuring datetime.datetime to datetime - how to import is

Re: python3.1 shell and Arrow Keys ?

2009-10-08 Thread Peter Billam
On 2009-10-08, casevh cas...@gmail.com wrote: On Oct 8, 2:47 pm, Peter Billam pe...@www.pjb.com.au 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

Re: Sentiment analysis using Python

2009-10-08 Thread alex23
On Oct 9, 10:26 am, Henrik Lied henrikl...@gmail.com 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

Re: datetime.datetime. or datetime. ?

2009-10-08 Thread Carl Banks
On Oct 8, 3:11 pm, niklasr nikla...@gmail.com wrote: On Oct 8, 5:25 pm, Diez B. Roggisch de...@nospam.web.de 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

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

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! snip 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: 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 pfeld...@verizon.net 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 --

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

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 --

[issue6962] traceback.format_exception_only does not return SyntaxError carot correctly

2009-10-08 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti resolution: - duplicate ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6962 ___

[issue7079] file_close() ignores return value of close_the_file

2009-10-08 Thread Gregory P. Smith
Changes by Gregory P. Smith g...@krypto.org: -- assignee: - gregory.p.smith priority: - high ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7079 ___

[issue7077] SysLogHandler can't handle Unicode

2009-10-08 Thread Robert Szefler
Robert Szefler robert.szef...@redefine.pl added the comment: Fine with me, though problems would arise. Default encoding for example. If encoding selection is mandatory it would break compatibility. Using default locale is not such a good idea - local machine's locale would generally not need to

[issue4064] distutils.util.get_platform() is wrong for universal builds on macosx

2009-10-08 Thread Michael Wise
Michael Wise michael.w...@uwa.edu.au added the comment: While the discussion seems to think the matter is closed, I wanted to install numpy 1.30 which requires Python 2.6 and all my machines are PPC (G4 or G5 - nice architectures). gcc-4.0 -arch ppc -arch i386 -fno-strict-aliasing ...

[issue5511] zipfile - add __exit__ attribute to make ZipFile object compatible with with_statement

2009-10-08 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- keywords: -needs review, patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5511 ___ ___

[issue4064] distutils.util.get_platform() is wrong for universal builds on macosx

2009-10-08 Thread Ronald Oussoren
Ronald Oussoren ronaldousso...@mac.com added the comment: Michael: please file a new issue for this, your problem seems to be unrelated to this one. In that issue include information about: 1) The python version you are using 2) The version of MacOSX 3) The version of Xcode (open

[issue7077] SysLogHandler can't handle Unicode

2009-10-08 Thread Vinay Sajip
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment: Robert Szefler added the comment: Fine with me, though problems would arise. Default encoding for example. If encoding selection is mandatory it would break compatibility. Using default locale is not such a good idea - local

  1   2   >