[ANN] mlabwrap 1.0.1 released

2009-03-25 Thread Alexander Schmolck
Mlabwrap allows pythonistas to interface to Matlab(tm) in a very straightforward fashion: from mlabwrap import mlab mlab.eig([[0,1],[1,1]]) array([[-0.61803399], [ 1.61803399]]) More at http://mlabwrap.sourceforge.net. Mlabwrap 1.0.1 is just a maintenance release that

[ANN] pylint 0.18 / logilab-astng 0.19 / logilab-common 0.39

2009-03-25 Thread Sylvain Thénault
I'm pleased to announce releases of pylint 0.18, logilab-astng 0.19 and logilab-common 0.39. All these packages should now be cleanly available through easy install. Also, happy pylint users will get: * fixed python 2.6 support (pylint/astng tested from 2.4 to 2.6) * get source code (and so

notmm 0.2.12 20090322

2009-03-25 Thread Etienne Robillard
Hello everyone, First, I'd like thanking the new members that joined this group recently. Since notmm started as a hobby project, its great seeing it growing and becoming essentially a more mature project. :) Hence, I'm pleased to announce the release of notmm 0.2.12 20090322, the first

Leo 4.6 beta 1 released

2009-03-25 Thread Edward K Ream
Leo 4.6 b1 is now available at: http://sourceforge.net/project/showfiles.php?group_id=3458package_id=29106 Leo is a text editor, data organizer, project manager and much more. See: http://webpages.charter.net/edreamleo/intro.html The highlights of Leo 4.6: -- - Leo now

ANN: Pylot version 1.22 released (web load/performance tool)

2009-03-25 Thread cgoldberg
We just did a new release of Pylot (version 1.22): http://www.pylot.org/download.html Pylot is a free open source tool for testing performance and scalability of web services. It runs HTTP load tests, which are useful for capacity planning, benchmarking, analysis, and system tuning. Pylot

Advanced Scientific Programming in Python Summer School in Berlin, Germany

2009-03-25 Thread Tiziano Zito
Advanced Scientific Programming in Python a G-Node Summer School Many scientists spend much of their time writing, debugging, and maintaining software. But while techniques for doing this efficiently have been developed, only few scientists actually use them. As a result, they spend far too much

Re: fft of a dat file?

2009-03-25 Thread Steven D'Aprano
On Wed, 25 Mar 2009 11:26:00 +0530, Soumen banerjee wrote: Hello, I'm kind of new to python and i wanted to do a little project, make a frequency plot of some wav audio. I have been following this webpage http://www.acronymchile.com/sigproc.html and have got to the making of a dat file

Fw: Query regarding Python sybase module

2009-03-25 Thread srinivasan srinivas
- Forwarded Message From: srinivasan srinivas sri_anna...@yahoo.co.in To: s...@pobox.com Sent: Tuesday, 24 March, 2009 7:42:35 PM Subject: Re: Query regarding Python sybase module NO. I tried with what u have mentioned in the previous update. But it gave only one result set.

Re: fft of a dat file?

2009-03-25 Thread Soumen banerjee
Hello I have not tried the code because in no part of the code is the array out being created. As such, it is bound to return an error that out isnt created. The point here is how i can get sampled values from the dat file which has lines like this:- sampling Timesampled Value \r\n i need

Re: Relative Imports, why the hell is it so hard?

2009-03-25 Thread Kay Schluehr
On 25 Mrz., 05:56, Carl Banks pavlovevide...@gmail.com wrote: On Mar 24, 8:32 pm, Istvan Albert istvan.alb...@gmail.com wrote: On Mar 24, 9:35 pm, Maxim Khitrov mkhit...@gmail.com wrote: Works perfectly fine with relative imports. This only demonstrates that you are not aware of what

Re: Does Python have certificate?

2009-03-25 Thread afriere
On Mar 24, 12:50 pm, Johannes Bauer dfnsonfsdu...@gmx.de wrote: Sebastian Bassi schrieb: I'll hand out the Johannes Bauer Python Certificate of Total Awesomeness for anyone who can write a hello world in python and hands me $25000 in cash. $25,000?! For a certificate? You must be kidding!

Re: file open fails.

2009-03-25 Thread afriere
Wouldn't it be easier just to avoid the windows slashes altogether and stick to the posix: title = 'c:/thesis/refined_title.txt' -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter - Multiple Tk() instances/mainloops in one process?

2009-03-25 Thread Robin Becker
Gregory Sheaffer wrote: So, basically, is this a problem inherent in using Tkinter? And if so, are there any workarounds besides tying the windows to a root Tk() in the main program (Which isn't really an option the way the system is currently designed). probably, see

Re: Does Python have certificate?

2009-03-25 Thread Tim Chase
afri...@yahoo.co.uk wrote: On Mar 24, 12:50 pm, Johannes Bauer dfnsonfsdu...@gmx.de wrote: Sebastian Bassi schrieb: I'll hand out the Johannes Bauer Python Certificate of Total Awesomeness for anyone who can write a hello world in python and hands me $25000 in cash. $25,000?! For a

Re: Tkinter - Multiple Tk() instances/mainloops in one process?

2009-03-25 Thread andrew cooke
i havn't used tkinter for years, and can't remember a thing about it, but many gui toolkits (not just in python) manage a single event loop and need care when working with multiple threads. that doesn't mean that you cannot have multithreaded programs, but does mean that you do not invoke gui

[ANN] pylint 0.18 / logilab-astng 0.19 / logilab-common 0.39

2009-03-25 Thread Sylvain Thénault
-- Sylvain Thénault LOGILAB, Paris (France) Formations Python, Zope, Plone, Debian: http://www.logilab.fr/formations Développement logiciel sur mesure: http://www.logilab.fr/services Python et calcul scientifique: http://www.logilab.fr/science --

Re: [ANN] pylint 0.18 / logilab-astng 0.19 / logilab-common 0.39

2009-03-25 Thread Sylvain Thénault
oops, forgot the mail content :$ Here it is... I'm pleased to announce releases of pylint 0.18, logilab-astng 0.19 and logilab-common 0.39. All these packages should now be cleanly available through easy install. Also, happy pylint users will get: * fixed python 2.6 support (pylint/astng

Re: Unit testing frameworks

2009-03-25 Thread Fabio Zadrozny
Hi Andew, not exactly a framework, but useful while working on small projects - you can run tests from inside eclipse (using the pydev plugin for python). it's easy to run all tests or some small subset (although it is a bit buggy for 3.0). What exactly is not working with 3.0? (couldn't

Re: [ANN] pylint 0.18 / logilab-astng 0.19 / logilab-common 0.39

2009-03-25 Thread andrew cooke
python 3? :o) (thanks anyway - pylint is very useful, and saved me much work) Sylvain Thénault wrote: oops, forgot the mail content :$ Here it is... I'm pleased to announce releases of pylint 0.18, logilab-astng 0.19 and logilab-common 0.39. All these packages should now be cleanly

Re: Wiki syntax available when publishing on pypi

2009-03-25 Thread Luca
On Tue, Mar 24, 2009 at 3:06 PM, andrew cooke and...@acooke.org wrote: it's some form of restructured text, which is described at http://docutils.sourceforge.net/rst.html however, there seem to be various implementations; i don't know if pypi exactly follows what is described there (i know i

Re: Unit testing frameworks

2009-03-25 Thread andrew cooke
Fabio Zadrozny wrote: not exactly a framework, but useful while working on small projects - you can run tests from inside eclipse (using the pydev plugin for python). it's easy to run all tests or some small subset (although it is a bit buggy for 3.0). What exactly is not working with 3.0?

Re: Unit testing frameworks

2009-03-25 Thread andrew cooke
copy+paste error; the correct Python2.6 details are: Python 2.6 (r26:66714, Feb 3 2009, 20:49:49) andrew cooke wrote: this is with a homebuilt 3.0 - Python 3.0 (r30:67503, Jan 16 2009, 06:50:19) and opensuse's default 2.6 - Python 3.0 (r30:67503, Jan 16 2009, 06:50:19) - on Eclipse 3.3.2

Re: Unit testing frameworks

2009-03-25 Thread grkuntzmd
In unittest, has anyone used the *NIX command find to automatically build a test suite file of all tests under a specified directory? I generally name my tests as _Test_ORIGINAL_MODULE_NAME.py where ORIGINAL_MODULE_NAME is the obvious value. This way, I can include/ exclude them from deployments,

Re: [ANN] pylint 0.18 / logilab-astng 0.19 / logilab-common 0.39

2009-03-25 Thread Sylvain Thénault
Le Wednesday 25 March 2009 11:58:37 andrew cooke, vous avez écrit : python 3? :o) python 3 support is no much far away now that we support the new _ast module. logilab-common already has its py3k branch in the source repository... So it's in the plan, but any helps appreciated of course ;) --

Re: Problem Python 2.6.1 vs 2.6 pyWin32

2009-03-25 Thread Mark Hammond
On 25/03/2009 11:06 AM, John Machin wrote: It would appear that the safest cover-most-bases option for a developer/packager of pure-Python packages (especially one intended to be runnable on older versions of Python, some as far back as 2.1) is to use Python 2.5 to make the bdist_wininst (the

Re: script files with python (instead of tcsh/bash)?

2009-03-25 Thread Esmail
Hello David, R. David Murray wrote: Esmail ebo...@hotmail.com wrote: Here's a more Pythonic way to do that: with open('somefile') as f: for line in f: if 'somestring' in line: #do something In other words, you don't have to read the lines into a list

Does __init__ of subclass need the same argument types as __init__ of base class?

2009-03-25 Thread Sibylle Koczian
I do more or less understand this error message: import datetime x1 = datetime.date.today() x2 = datetime.date(x1) Traceback (most recent call last): File stdin, line 1, in module TypeError: an integer is required I don't understand at all why I get the same message with this little script:

Re: Does __init__ of subclass need the same argument types as __init__ of base class?

2009-03-25 Thread Bruno Desthuilliers
Sibylle Koczian a écrit : (snip) I don't understand at all why I get the same message with this little script: import datetime class meindatum(datetime.date): def __init__(self, datum): print meindatum datetime.date.__init__(self, datum.year,

Re: Python 3 consistency proposal

2009-03-25 Thread Bruno Desthuilliers
Ben Finney a écrit : Steven D'Aprano ste...@remove.this.cybersource.com.au writes: If you *are* willing to do the work, the chances would still be pretty slim. Guido has just rejected a patch adding PEP 8 compliant aliases for types like datetime […] As Guido has quoted before, A foolish

Re: script files with python (instead of tcsh/bash)?

2009-03-25 Thread Peter Otten
Esmail wrote: Hello David, R. David Murray wrote: Esmail ebo...@hotmail.com wrote: Here's a more Pythonic way to do that: with open('somefile') as f: for line in f: if 'somestring' in line: #do something In other words, you don't have to

Re: script files with python (instead of tcsh/bash)?

2009-03-25 Thread Esmail
Peter Otten wrote: In this case I believe I needed the contents in a list because the line I was looking for was above one that I could easily identify. Ie, once I had the index, I could go back/up one index to find the line I needed to process. Here's one way to avoid the list: last_line =

Re: Python 3 consistency proposal

2009-03-25 Thread Colin J. Williams
gert wrote: Rename all built in classes with a capital letter example Str() Int() Object() Make () optional for a function definition class Test: pass def test: pass Any chance Guido would approve this :-) Zero. But I like the idea. Is version 3 really sacrosanct? I wonder how

Re: Problem Python 2.6.1 vs 2.6 pyWin32

2009-03-25 Thread John Machin
On 25/03/2009 10:32 PM, Mark Hammond wrote: On 25/03/2009 11:06 AM, John Machin wrote: It would appear that the safest cover-most-bases option for a developer/packager of pure-Python packages (especially one intended to be runnable on older versions of Python, some as far back as 2.1) is to

Re: [ANN] pylint 0.18 / logilab-astng 0.19 / logilab-common 0.39

2009-03-25 Thread Colin J. Williams
Sylvain Thénault wrote: Le Wednesday 25 March 2009 11:58:37 andrew cooke, vous avez écrit : python 3? :o) python 3 support is no much far away now that we support the new _ast module. logilab-common already has its py3k branch in the source repository... So it's in the plan, but any helps

Re: Async serial communication/threads sharing data

2009-03-25 Thread Jean-Paul Calderone
On Tue, 24 Mar 2009 22:20:49 -0700, John Nagle na...@animats.com wrote: Jean-Paul Calderone wrote: On Mon, 23 Mar 2009 05:30:04 -0500, Nick Craig-Wood n...@craig-wood.com wrote: Jean-Paul Calderone exar...@divmod.com wrote: [snip] After bringing in all the heavy machinery of Twisted,

Re: Does Python have certificate?

2009-03-25 Thread Christiaan Putter
-- Forwarded message -- From: Christiaan Putter ceput...@googlemail.com Date: 2009/3/25 Subject: Re: Does Python have certificate? To: Tim Chase t...@thechases.com Come now guys, don't be so harsh. Certification is really important.  Without My Crappy Software Degree my boss

Re: Does Python have certificate?

2009-03-25 Thread andrew cooke
Christiaan Putter wrote: Certification is really important.  Without My Crappy Software Degree my boss wouldn't have thought I'd be able to surf the internet, trolling mailing lists to scout for other highly certified programming whores. apologies, this is way off-topic, but kind-of related.

Leo 4.6 beta 1 released

2009-03-25 Thread Edward K Ream
Leo 4.6 b1 is now available at: http://sourceforge.net/project/showfiles.php?group_id=3458package_id=29106 Leo is a text editor, data organizer, project manager and much more. See: http://webpages.charter.net/edreamleo/intro.html The highlights of Leo 4.6: -- - Leo now

How can I know if a date is prior to today?

2009-03-25 Thread Giampaolo Rodola'
Hi, I have a date expressed in seconds. I'd want to pretty print it as %H:%M if the time refers to today and %b%d (month, day) if it's of yesterday or before. I managed to do that with the code below but I don't like it too much. Is there a better way to do that? Thanks in advance. import time

Re: How can I know if a date is prior to today?

2009-03-25 Thread Paul McGuire
On Mar 25, 8:31 am, Giampaolo Rodola' gne...@gmail.com wrote: Hi, I have a date expressed in seconds. I'd want to pretty print it as %H:%M if the time refers to today and %b%d (month, day) if it's of yesterday or before. Use datetime module. import time from datetime import datetime now =

Re: PEP 3143: Standard daemon process library

2009-03-25 Thread Ben Finney
Ben Finney ben+pyt...@benfinney.id.au writes: I've submitted PEP 3143 URL:http://www.python.org/dev/peps/pep-3143/ to meet this need, and have re-worked an existing library into a new ‘python-daemon’ URL:http://pypi.python.org/pypi/python-daemon/ library, the reference implementation. Now

Re: How can I know if a date is prior to today?

2009-03-25 Thread Tim Chase
I have a date expressed in seconds. I'd want to pretty print it as %H:%M if the time refers to today and %b%d (month, day) if it's of yesterday or before. I managed to do that with the code below but I don't like it too much. Is there a better way to do that? Thanks in advance. import time

Re: fft of a dat file?

2009-03-25 Thread R. David Murray
Soumen banerjee soume...@gmail.com wrote: Hello I have not tried the code because in no part of the code is the array out being created. As such, it is bound to return an error that out isnt created. The point here is how i can get sampled values from the dat file which has lines like this:-

Re: Unicode problem in ucs4

2009-03-25 Thread abhi
On Mar 24, 4:55 am, Martin v. Löwis mar...@v.loewis.de wrote: So, both Py_UNICODE and wchar_t are 4 bytes and since it contains 3 \0s after a char, printf or wprintf is only printing one letter. No. printf indeed will see a terminating character. However, wprintf should correctly know that

integrate does not work anymore

2009-03-25 Thread Doerte
Hello, some time ago I implemented a Python script, which uses integrate.quad (...). This was done with Python 2.4 / Win2000. I'm working with Python 2.5 now, and installed Numpy, Scipy and Matplotlib. My script and also the test described below do not work anymore: from pylab import * from

*args question

2009-03-25 Thread grocery_stocker
Given the following code... #!/usr/bin/env python import time import thread def myfunction(string,sleeptime,*args): while 1: print string time.sleep(sleeptime) #sleep for a specified amount of time. if __name__==__main__: thread.start_new_thread(myfunction,(Thread

Re: *args question

2009-03-25 Thread grocery_stocker
On Mar 25, 7:05 am, grocery_stocker cdal...@gmail.com wrote: Given the following code... #!/usr/bin/env python import time import thread def myfunction(string,sleeptime,*args): while 1: print string time.sleep(sleeptime) #sleep for a specified amount of time. if

Re: How can I know if a date is prior to today?

2009-03-25 Thread Giampaolo Rodola'
On 25 Mar, 14:51, Tim Chase python.l...@tim.thechases.com wrote: I have a date expressed in seconds. I'd want to pretty print it as %H:%M if the time refers to today and %b%d (month, day) if it's of yesterday or before. I managed to do that with the code below but I don't like it too

Re: integrate does not work anymore

2009-03-25 Thread Ulrich Eckhardt
Doerte wrote: from pylab import * from numpy import * from scipy import * from math import * Don't do this, read the style guide on writing Python code. res = integrate.quad(func=f, a=x0, b=x1) [...] NameError: name 'integrate' is not defined # try this instead from scipy import integrate

Another form of dynamic import

2009-03-25 Thread Marco Nawijn
Hello, In short I would like to know if somebody knows if it is possible to re-execute a statement that raised an exception? I will explain the reason by providing a small introduction on why this might be nice in my case and some example code. I am using the python bindings to a *very* large

Re: blocked on futex

2009-03-25 Thread Aahz
In article 5cffe00b-2cd3-45dc-a674-87466e8ff...@f19g2000vbf.googlegroups.com, msoulier msoul...@digitaltorque.ca wrote: On Mar 20, 10:22=A0am, a...@pythoncraft.com (Aahz) wrote: Have you tried dumping core and using gdb to find out more about the process state? Yeah, just did. I need the

Problems with threaded Hotkey application

2009-03-25 Thread Anita Whitney
A window comes up saying hotkeyapp has stopped working. How do I get in there to move the RegisterHotKey line to within the thread's run method, etc.? Im trying to do this myself and not pay Acer tech support. Thanks, Anita Whitney-- http://mail.python.org/mailman/listinfo/python-list

What way is the best to check an empty list?

2009-03-25 Thread srinivasan srinivas
For ex: to check list 'A' is empty or not.. if A == []: if A.count == 0: if len(A) == 0: if not A: Thanks, Srini Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/ -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I know if a date is prior to today?

2009-03-25 Thread John Machin
On Mar 26, 12:51 am, Tim Chase python.l...@tim.thechases.com wrote: I have a date expressed in seconds. I'd want to pretty print it as %H:%M if the time refers to today and %b%d (month, day) if it's of yesterday or before. I managed to do that with the code below but I don't like it too

Re: What way is the best to check an empty list?

2009-03-25 Thread Andre Engels
On Wed, Mar 25, 2009 at 3:38 PM, srinivasan srinivas sri_anna...@yahoo.co.in wrote: For ex: to check list 'A' is empty or not.. if A == []: if A.count == 0: if len(A) == 0: if not A: I would go for the last one, because it has the highest likelihood of doing what is intended when fed with

Re: What way is the best to check an empty list?

2009-03-25 Thread Tim Chase
srinivasan srinivas wrote: For ex: to check list 'A' is empty or not.. if A == []: if A.count == 0: if len(A) == 0: if not A: if not A -tkc -- http://mail.python.org/mailman/listinfo/python-list

Re: What way is the best to check an empty list?

2009-03-25 Thread bearophileHUGS
srinivasan srinivas: For ex: to check list 'A' is empty or not.. Empty collections are false: if somelist: ... # somelist isn't empty else: ... # somelist is empty Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: What way is the best to check an empty list?

2009-03-25 Thread John Machin
On Mar 26, 1:38 am, srinivasan srinivas sri_anna...@yahoo.co.in wrote: Depends on what you mean by best; like graduation day at kindergarten, everyone gets a prize: For ex: to check list 'A' is empty or not.. if A == []: most obviously correct if A.count == 0: best use of imagination if

Re: Does __init__ of subclass need the same argument types as __init__ of base class?

2009-03-25 Thread Hrvoje Niksic
Bruno Desthuilliers bruno.42.desthuilli...@websiteburo.invalid writes: The print command inside the __init__ method isn't executed, so that method doesn't seem to start at all. this often happens with (usually C-coded) immutable types. The initializer is not called, only the proper

Re: What way is the best to check an empty list?

2009-03-25 Thread andrew cooke
i will go against the grain slightly and say that len is probably the best compromise in most situations (although i admit i don't know what count is) because i think it will work when you expect it to and break when you have a bug in your program. using a simple boolean is more robust (and what

py2exe - win32com - GetGeneratePath Error

2009-03-25 Thread Christopher Panici
Has anyone solved the GetGeneratePath Error? I am getting this when I use win32com.client.DispatchWithEvents('iTunes.Application', customEventHandler). I have drilled down to the file and found it in that path. Does anyone have any ideas? HERE IS THE ERROR. If anyone is good at this please

Debugging in Py

2009-03-25 Thread *nixtechno
I'm just wondering if you all have any resources on Debugging that you all would recommend. Due to the fact I'm doing some debugging as a beginner and this has the best of me, and I'm looking at trying to learn more about what and how to debug within Py using print, and etc... There is so much

Re: *args question

2009-03-25 Thread John Machin
On Mar 26, 1:17 am, grocery_stocker cdal...@gmail.com wrote: On Mar 25, 7:05 am, grocery_stocker cdal...@gmail.com wrote: Given the following code... #!/usr/bin/env python import time import thread def myfunction(string,sleeptime,*args):     while 1:         print string    

Re: Does __init__ of subclass need the same argument types as __init__ of base class?

2009-03-25 Thread Sibylle Koczian
Bruno Desthuilliers schrieb: Sibylle Koczian a écrit : (snip) The print command inside the __init__ method isn't executed, so that method doesn't seem to start at all. this often happens with (usually C-coded) immutable types. The initializer is not called, only the proper constructor

Re: What way is the best to check an empty list?

2009-03-25 Thread Andre Engels
On Wed, Mar 25, 2009 at 4:21 PM, andrew cooke and...@acooke.org wrote: i will go against the grain slightly and say that len is probably the best compromise in most situations (although i admit i don't know what count is) because i think it will work when you expect it to and break when you

Re: *args question

2009-03-25 Thread Tim Chase
grocery_stocker wrote: On Mar 25, 7:05 am, grocery_stocker cdal...@gmail.com wrote: Given the following code... #!/usr/bin/env python import time import thread def myfunction(string,sleeptime,*args): while 1: print string time.sleep(sleeptime) #sleep for a specified

Re: What way is the best to check an empty list?

2009-03-25 Thread John Machin
On Mar 26, 2:21 am, andrew cooke and...@acooke.org wrote: i will go against the grain slightly and say that len is probably the best compromise in most situations (although i admit i don't know what count is) because i think it will work when you expect it to and break when you have a bug in

SyntaxError: invalid syntax (windows)

2009-03-25 Thread Python Newsgroup
I'm a total newbe to scripting not to mention python. However I was able to successfully create a telnet script to initiate login, initiate tftp, exit, exit, confirm and close session. Frustrated, possibly causing my own misery. I replace the sript the script with the standard example. import

Re: *args question

2009-03-25 Thread grocery_stocker
On Mar 25, 8:28 am, Tim Chase python.l...@tim.thechases.com wrote: grocery_stocker wrote: On Mar 25, 7:05 am, grocery_stocker cdal...@gmail.com wrote: Given the following code... #!/usr/bin/env python import time import thread def myfunction(string,sleeptime,*args): while 1:

Re: SyntaxError: invalid syntax (windows)

2009-03-25 Thread Gary Herron
Python Newsgroup wrote: I'm a total newbe to scripting not to mention python. However I was able to successfully create a telnet script to initiate login, initiate tftp, exit, exit, confirm and close session. Frustrated, possibly causing my own misery. I replace the sript the script with the

Re: Debugging in Py

2009-03-25 Thread Tim Chase
I'm just wondering if you all have any resources on Debugging that you all would recommend. Due to the fact I'm doing some debugging as a beginner and this has the best of me, and I'm looking at trying to learn more about what and how to debug within Py using print, and etc... For most of what

Re: SyntaxError: invalid syntax (windows)

2009-03-25 Thread MRAB
Python Newsgroup wrote: I'm a total newbe to scripting not to mention python. However I was able to successfully create a telnet script to initiate login, initiate tftp, exit, exit, confirm and close session. Frustrated, possibly causing my own misery. I replace the sript the script with the

Re: Problems with threaded Hotkey application

2009-03-25 Thread Michael Torrie
Anita Whitney wrote: A window comes up saying hotkeyapp has stopped working. How do I get in there to move the RegisterHotKey line to within the thread's run method, etc.? Im trying to do this myself and not pay Acer tech support. Thanks, Anita Whitney Is this a wxPython application that you

Re: *args question

2009-03-25 Thread Tim Chase
Maybe I'm missing it, but in the original code, the line had thread.start_new_thread(myfunction,(Thread No:1,2)) It has a single arg (Thread No:1,2) versus something like thread.start_new_thread(myfunction,1, 2, (Thread No:1,2)) But def myfunction(string,sleeptime,*args): clearly takes two

Re: Another form of dynamic import

2009-03-25 Thread Kay Schluehr
On 25 Mrz., 15:23, Marco Nawijn naw...@gmail.com wrote: Hello, In short I would like to know if somebody knows if it is possible to re-execute a statement that raised an exception? I will explain the reason by providing a small introduction on why this might be nice in my case and some

Re: SyntaxError: invalid syntax (windows)

2009-03-25 Thread Python Newsgroup
Thats newbe experience for ya ;-) thanks. Its seems to work and leads to another question. whether running the script or stepping thru the process at the command line I get what looks like hex C:\Python30python \Python30\scripts\telnet-tftp1.py

Re: *args question (correction)

2009-03-25 Thread Tim Chase
thread.start_new_thread(myfunc, some string, 42) This should have been thread.start_new_thread(myfunc, (some string, 42)) because all the subsequent values after the function-handle/name get passed into the function when it gets called. As if the start_new_thread() function was

Re: distutils compiler flags for extension modules

2009-03-25 Thread Christian Meesters
Thanks! I'll try that. Sorry for replying so late - just didn't get to it. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: *args question

2009-03-25 Thread Dave Angel
Try the following, to call your function yourself in this way: def myfunction(string,sleeptime,*args): while 1: print string is , string time.sleep(sleeptime) #sleep for a specified amount of time. f = myfunction r = (Thread No:1,2) f(*r) The key here is the *r syntax,

Re: SyntaxError: invalid syntax (windows)

2009-03-25 Thread Python Newsgroup
Gotcha, I got started from the telnet example listed in the docs. The linux install was via yum and installed 2.x instead. That explains it. Althought print (tn.read_all () ) runs in 2.x on linux. I have another problem maybe you cna help me with. My telnet output jibberish in windows: I cna

Re: SyntaxError: invalid syntax (windows)

2009-03-25 Thread MRAB
Python Newsgroup wrote: Gotcha, I got started from the telnet example listed in the docs. The linux install was via yum and installed 2.x instead. That explains it. Althought print (tn.read_all () ) runs in 2.x on linux. I have another problem maybe you cna help me with. My telnet output

Re: Another form of dynamic import

2009-03-25 Thread pruebauno
On Mar 25, 10:23 am, Marco Nawijn naw...@gmail.com wrote: Hello, In short I would like to know if somebody knows if it is possible to re-execute a statement that raised an exception? I will explain the reason by providing a small introduction on why this might be nice in my case and some

Re: SyntaxError: invalid syntax (windows)

2009-03-25 Thread Terry Reedy
MRAB wrote: Python Newsgroup wrote: Gotcha, I got started from the telnet example listed in the docs. The linux install was via yum and installed 2.x instead. That explains it. Althought print (tn.read_all () ) runs in 2.x on linux. I have another problem maybe you cna help me with. My

Re: Another form of dynamic import

2009-03-25 Thread Terry Reedy
Marco Nawijn wrote: In short I would like to know if somebody knows if it is possible to re-execute a statement that raised an exception? In short, no. As an example, look at the following statement aPoint = gp_Pnt(1.0, 0.0, 0.0) # Oops, this will raise a NameError, since

iteration without storing a variable

2009-03-25 Thread Josh Dukes
So The metasploit framework was suffering from some performance issues which they fixed. http://www.metasploit.com/blog/ I was interested in comparing this to python. Language comparisons are not generally very useful for a number of reasons, but some might find this interesting. Clearly the

Re: Another form of dynamic import

2009-03-25 Thread Albert Hopkins
Also, instead of caching exceptions you can do lazy lookups kinda like this: - # a.py class A: pass - # b.py class B:

Re: iteration without storing a variable

2009-03-25 Thread Stefan Behnel
Josh Dukes wrote: $ time python -c 'a = A; for r in xrange(10): a += A ' real 0m0.109s user 0m0.100s sys 0m0.010s Anyone get different results? Sure: $ time python -c 'a = A; for r in xrange(10): a += A ' real0m0.140s user0m0.132s sys 0m0.008s Stefan (BTW,

time.strptime() undocumented difference python 2.5.12.5.2

2009-03-25 Thread TYR
A server that runs one of my programs was upgraded to Debian Lenny last night, which moved it from Python 2.4.4 to 2.5.2. This caused immediate trouble. At one point, data is parsed from a Web page, and among other things a time date group is collected. This is in a nice human readable format, but

Re: iteration without storing a variable

2009-03-25 Thread Josh Dukes
well if we're interested in that... $ uname -a Linux IT2-JD 2.6.27-gentoo-r8 #1 SMP Tue Mar 17 14:28:19 PDT 2009 x86_64 Intel(R) Pentium(R) D CPU 2.80GHz GenuineIntel GNU/Linux $ python --version Python 2.5.2 $ ruby --version ruby 1.8.6 (2008-08-11 patchlevel 287) [x86_64-linux] but I was

Re: Another form of dynamic import

2009-03-25 Thread Anton Hartl
On 2009-03-25, Marco Nawijn naw...@gmail.com wrote: Hello, In short I would like to know if somebody knows if it is possible to re-execute a statement that raised an exception? I will explain the reason by providing a small introduction on why this might be nice in my case and some example

Re: time.strptime() undocumented difference python 2.5.12.5.2

2009-03-25 Thread MRAB
TYR wrote: A server that runs one of my programs was upgraded to Debian Lenny last night, which moved it from Python 2.4.4 to 2.5.2. This caused immediate trouble. At one point, data is parsed from a Web page, and among other things a time date group is collected. This is in a nice human

Re: What way is the best to check an empty list?

2009-03-25 Thread Raymond Hettinger
On Mar 25, 7:38 am, srinivasan srinivas sri_anna...@yahoo.co.in wrote: For ex: to check list 'A' is empty or not.. if A == []: if A.count == 0: if len(A) == 0: if not A: PEP 8 recommends the latter. Raymond -- http://mail.python.org/mailman/listinfo/python-list

Re: iteration without storing a variable

2009-03-25 Thread Stefan Behnel
Josh Dukes wrote: $ python --version Python 2.5.2 $ ruby --version ruby 1.8.6 (2008-08-11 patchlevel 287) [x86_64-linux] but I was more talking about the speed differences between ruby and python. I heard that Ruby 1.9 is supposed to be a lot faster than 1.8 in many aspects (as is Py2.6

Re: What way is the best to check an empty list?

2009-03-25 Thread andrew cooke
Andre Engels wrote: On Wed, Mar 25, 2009 at 4:21 PM, andrew cooke and...@acooke.org wrote: i will go against the grain slightly and say that len is probably the best compromise in most situations (although i admit i don't know what [...] but i may be wrong - are there any containers (apart

Re: Mangle function name with decorator?

2009-03-25 Thread J. Cliff Dyer
On Wed, 2009-03-18 at 08:18 -0700, Adam wrote: On Mar 18, 10:33 am, J. Cliff Dyer j...@sdf.lonestar.org wrote: You might be interested in redefining __getattribute__(self, attr) on your class. This could operate in conjunction with the hash tables (dictionaries) mentioned by andrew cooke.

Cross platform installer builder for Python? (like IzPack for Java)

2009-03-25 Thread W. Martin Borgert
Hi, I'm looking for an installer builder similar to IzPack (which is based on Java). Isn't there anything like that in the Python world? Extra points, if GTK+ or wxWindows is used... TIA! -- http://mail.python.org/mailman/listinfo/python-list

Re: What way is the best to check an empty list?

2009-03-25 Thread Stef Mientki
andrew cooke wrote: Andre Engels wrote: On Wed, Mar 25, 2009 at 4:21 PM, andrew cooke and...@acooke.org wrote: i will go against the grain slightly and say that len is probably the best compromise in most situations (although i admit i don't know what [...] but i may be

Re: Threading and tkinter

2009-03-25 Thread gert
On Mar 7, 9:40 am, Jani Hakala jahak...@iki.fi wrote: After reading the docs and seeing a few examples i think this should work ? Am I forgetting something here or am I doing something stupid ? Anyway I see my yellow screen, that has to count for something :) I have been using the

Re: minor revision encoded in SONAME in libpython.so

2009-03-25 Thread szager
On Mar 24, 2:23 pm, Martin v. Löwis mar...@v.loewis.de wrote: So, for example, if I upgrade to libpython2.6.so.1.1 How do you do that? There won't ever be such a library. They will always be called libpython2.6.so.1.0. So no, no minor revision gets encoded into the SONAME. Then what's the

Re: Relative Imports, why the hell is it so hard?

2009-03-25 Thread Gabriel Genellina
En Tue, 24 Mar 2009 21:57:12 -0300, Istvan Albert istvan.alb...@gmail.com escribió: On Mar 24, 3:16 pm, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: Did you know, once a module is imported by the first time yeah yeah, could we not get sidetracked with details that are not relevant? what

  1   2   >