ANN: XYZCommander-0.0.4

2010-05-07 Thread Max E. Kuznecov
XYZCommander is a pure console visual file manager. Main features: * Tight integration with python run–time system — most of the settings can be changed on the fly using management console. * Powerful configuration system - define own actions, aliases, internal commands, key bindings. *

Re: Broken pipe

2010-05-07 Thread Ron Eggler
On May 6, 2010 10:37:14 pm Chris Rebert wrote: On Thu, May 6, 2010 at 10:27 PM, cerr ron.egg...@gmail.com wrote: Hi There, I'm very new to Python and i wanna write a script that sends a certain string to a server. The code I came up with looks like this: #!/usr/bin/python import

Re: Broken pipe

2010-05-07 Thread Chris Rebert
On Thu, May 6, 2010 at 11:11 PM, Ron Eggler ron.egg...@gmail.com wrote: On May 6, 2010 10:37:14 pm Chris Rebert wrote: On Thu, May 6, 2010 at 10:27 PM, cerr ron.egg...@gmail.com wrote: Hi There, I'm very new to Python and i wanna write a script that sends a certain string to a server.

Re: Python - MySQL fetching values

2010-05-07 Thread Kurian Thayil
On Thu, May 6, 2010 at 2:42 PM, Chris Rebert c...@rebertia.com wrote: On Thu, May 6, 2010 at 1:47 AM, Kurian Thayil kurianmtha...@gmail.com wrote: snip the expected output is 05:35:05. Now, here is code snippet, cursor1=getconnect1.cursor()

No module named server

2010-05-07 Thread Thomas Lehmann
Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit (Intel)] on win32 Script: from http.server import HTTPServer, CGIHTTPRequestHandler Result: Traceback (most recent call last): File http.py, line 1, in module from http.server import HTTPServer, CGIHTTPRequestHandler

Re: fast regex

2010-05-07 Thread Helmut Jarausch
On 05/06/10 16:52, james_027 wrote: hi, I was working with regex on a very large text, really large but I have time constrained. Does python has any other regex library or string manipulation library that works really fast? Have a look at

Re: No module named server

2010-05-07 Thread Thomas Lehmann
Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit Also after installing Python 3.1.2 the problem is still there. -- http://mail.python.org/mailman/listinfo/python-list

Re: No module named server

2010-05-07 Thread Andi Albrecht
Thomas Lehmann t.lehm...@rtsgroup.net schrieb: Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit (Intel)] on win32 Script: from http.server import HTTPServer, CGIHTTPRequestHandler Result: Traceback (most recent call last): File http.py, line 1, in module from

Re: No module named server

2010-05-07 Thread Thomas Lehmann
On 7 Mai, 10:02, Thomas Lehmann t.lehm...@rtsgroup.net wrote: Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit Also after installing Python 3.1.2 the problem is still there. I know the problem. Reading a book about a simple cgi web server the descriptions says to use

Re: Windows - select.select, timeout and KeyboardInterrupt

2010-05-07 Thread Paul Moore
On 6 May, 20:58, Thomas Heller thel...@ctypes.org wrote: If you look at the source code for time.sleep(), which CAN be interrupted by pressing Ctrl-C, you will find that it is carefully programmed to be interruptible (sp?).  Which is not the case for select.select(), obviously. Thanks - given

ActivePython - how to configure portable framework?

2010-05-07 Thread balzer
I downloaded ActivePython-2.6.5.12-win32-x86.zip, it contains two folders and 3 files: SystemFolder INSTALLDIR sh2.py install.bat _install.py Anyone know how to configure this Python environment as portable application to work with it without installation, to set a fully-functional Python

importing modules

2010-05-07 Thread Richard Lamboj
Hello, I have a question about importing python modules. I have modul package, with submodules. So how can a submodul access a modul that is on level upper? Is there something like import ../../blah? I don't mean something like this: import bla.blub.moep Kind Regards, Richi --

Re: importing modules

2010-05-07 Thread Alex Hall
I have a main folder. Inside that I have a modes package (subfolder holding __init__.py) as well as a misc package. When modes has to import helpers.py from misc, I use this: from .misc import helpers The period makes Python look up one level for misc, then go into it to find helpers. On 5/7/10,

Re: importing modules

2010-05-07 Thread Andi Albrecht
Richard Lamboj richard.lam...@bilcom.at schrieb: Hello, I have a question about importing python modules. I have modul package, with submodules. So how can a submodul access a modul that is on level upper? Is there something like import ../../blah? I don't mean something like this:

listing exported functions in a DLL

2010-05-07 Thread NickGB
is there a way using ctypes to list the exported functions of a DLL? This is what I was hoping to do... from ctypes import * myDLL = windll.some_dll # what is this method? does it exist? list_of_exported_functions = myDLL.list_exported_functions() --

Re: importing modules

2010-05-07 Thread Jean-Michel Pichavant
Richard Lamboj wrote: Hello, I have a question about importing python modules. I have modul package, with submodules. So how can a submodul access a modul that is on level upper? Is there something like import ../../blah? I don't mean something like this: import bla.blub.moep Kind

Re: Django as exemplary design

2010-05-07 Thread Aahz
In article 2010050619481239450-tomfsess...@gmailcom, TomF tomf.sess...@gmail.com wrote: I don't doubt it. But I'm not really interested in line (micro) level code issues at the moment. Not that my code couldn't stand being improved, but I'm more interested in seeing how medium/large OO python

Re: importing modules

2010-05-07 Thread Richard Lamboj
Am Friday 07 May 2010 13:50:15 schrieb Jean-Michel Pichavant: Richard Lamboj wrote: Hello, I have a question about importing python modules. I have modul package, with submodules. So how can a submodul access a modul that is on level upper? Is there something like import

Re: fast regex

2010-05-07 Thread Tim Chase
[your reply appears to have come only to me instead of the mailing list; CC'ing c.l.p in reply] On 05/06/2010 10:12 PM, James Cai wrote: When you say This does a replacement for every word in the input corpus (possibly with itself), but only takes one pass through the source text. It sounds

Re: List comprehension + lambdas - strange behaviour

2010-05-07 Thread Neil Cerutti
On 2010-05-07, Terry Reedy tjre...@udel.edu wrote: On 5/6/2010 3:34 PM, Artur Siekielski wrote: Hello. I found this strange behaviour of lambdas, closures and list comprehensions: funs = [lambda: x for x in range(5)] [f() for f in funs] [4, 4, 4, 4, 4] You succumbed to lambda hypnosis, a

Re: Movable Python or ActivePython

2010-05-07 Thread balzer
Sridhar Ratnakumar sridh...@activestate.com wrote in message news:mailman.2638.1273083585.23598.python-l...@python.org... On 2010-05-05, at 5:47 AM, balzer wrote: I want Python pack that can run without being installed, mostly for testing programs. As I read, Movable Python can run without

Re: importing modules

2010-05-07 Thread Jean-Michel Pichavant
Richard Lamboj wrote: Am Friday 07 May 2010 13:50:15 schrieb Jean-Michel Pichavant: Richard Lamboj wrote: Hello, I have a question about importing python modules. I have modul package, with submodules. So how can a submodul access a modul that is on level upper? Is there something

Re: Re: column selection

2010-05-07 Thread Dave Angel
Dave Angel wrote: div class=moz-text-flowed style=font-family: -moz-fixedmannu jha wrote: I tried with this: for line in open('1.txt'): columns = line.split() print columns[0], columns[1] if not line: continue but it is showing error: nmru...@caf:~ python split.py 24 ALA

Re: Movable Python or ActivePython

2010-05-07 Thread python
Balzer, I took a look at the zip version of ActiveState's Python. There's a related thread in on this mailing list where I asked if the zip files are missing the Microsoft VC runtime files required by the Python interpreter. According to Trent from ActiveState, this is indeed the case. I

Re: Movable Python or ActivePython

2010-05-07 Thread balzer
pyt...@bdurham.com wrote in message news:mailman.2732.1273237281.23598.python-l...@python.org... Balzer, I took a look at the zip version of ActiveState's Python. There's a related thread in on this mailing list where I asked if the zip files are missing the Microsoft VC runtime files

Re: pyjamas 0.7 released

2010-05-07 Thread lkcl
On May 2, 7:16 am, Wolfgang Strobl ne...@mystrobl.de wrote: lkcl luke.leigh...@googlemail.com: at least _some_ input would be good!  the knowledge doesn't have to be there: just the bugreports saying there's a problem and here's exactly how you reproduce it would be a start! So please make

Re: idiomatic way to collect and report multiple exceptions?

2010-05-07 Thread Steven D'Aprano
On Thu, 06 May 2010 21:56:10 -0700, Chris Rebert wrote: [...] Output from example: Traceback (most recent call last): File tmp.py, line 35, in module multiple_err.do_raise() File tmp.py, line 25, in do_raise raise self __main__.MultipleValidationErrors: See the following

Re: Movable Python or ActivePython

2010-05-07 Thread python
Balzer, I just need test a few python scripts. I recommend you look at Movable Python or Portable Python. Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: Re: column selection

2010-05-07 Thread mannu jha
On Fri, 07 May 2010 18:58:59 +0530 wrote mannu jha wrote: On Thu, 06 May 2010 18:54:59 +0530 wrote mannu jha wrote: I tried with this: for line in open('1.txt'): columns = line.split() print columns[0], columns[1]

Cross-platform file paths

2010-05-07 Thread utabintarbo
Until now, I have used the UNC under Windows (XP) to allow my program to access files located on a Samba-equipped *nix box (eg. os.path.normpath(r\\serverFQDN\sharename\dir\filename)). When I try to open this file under Linux (Red Hat 5), I get a file not found error. Is there a cross-platform

Re: CGI python 3 write RAW BINARY

2010-05-07 Thread Dodo
Le 01/05/2010 12:52, Dodo a écrit : Le 30/04/2010 17:52, Antoine Pitrou a écrit : Le Thu, 29 Apr 2010 23:37:32 +0200, Dodo a écrit : I don't get a thing. Now with the fix : All browsers shows a different thing, but not the image! http://ddclermont.homeip.net/misc/python/ If I save it to

Re: Windows - select.select, timeout and KeyboardInterrupt

2010-05-07 Thread Giampaolo Rodolà
You can easily avoid this by setting a lower timeout when calling asyncore.loop(), like 1 second or less (for example, Twisted uses 0.001 secs). Actually there's no reason for asyncore to have such a high default timeout (30 seconds). I think this should be signaled on the bug tracker. ---

Re: Classes: nested functions vs. private methodes

2010-05-07 Thread Steven D'Aprano
On Thu, 06 May 2010 12:40:16 +0200, Richard Lamboj wrote: Thank you for the nice sample, but what is with multiple inheritance in your sample? I mean the super call. Why not _MyClass.blah(self, arg). super() should work correctly when you have more complicated multiple inheritance, while

Re: Picking a license

2010-05-07 Thread Patrick Maupin
On May 6, 6:56 pm, Ben Finney ben+pyt...@benfinney.id.au wrote: a...@pythoncraft.com (Aahz) writes: In article 4be05d75.7030...@msn.com, Rouslan Korneychuk  rousl...@msn.com wrote: The only question I have now is what about licensing? Is that something I need to worry about? Should I go

Re: fast regex

2010-05-07 Thread Patrick Maupin
On May 6, 9:44 pm, james_027 cai.hai...@gmail.com wrote: On May 6, 11:33 pm, John Bokma j...@castleamber.com wrote: james_027 cai.hai...@gmail.com writes: I was working with regex on a very large text, really large but I have time constrained. Does python has any other regex library or

Re: Cross-platform file paths

2010-05-07 Thread cassiope
On May 7, 7:32 am, utabintarbo utabinta...@gmail.com wrote: Until now, I have used the UNC under Windows (XP) to allow my program to access files located on a Samba-equipped *nix box (eg. os.path.normpath(r\\serverFQDN\sharename\dir\filename)). When I try to open this file under Linux (Red Hat

Re: py3 tkinter acceps bytes. why?

2010-05-07 Thread Matthias Kievernagel
Me: If I don't want bytes to get passed to tkinter I just have to raise an exception in AsObj, no? Or is it even sufficient to just remove the bytes case? Martin v. Loewis mar...@v.loewis.de wrote: But why would you want that? There are commands which legitimately return bytes, e.g. the file

Re: Cross-platform file paths

2010-05-07 Thread utabintarbo
On May 7, 11:23 am, cassiope f...@u.washington.edu wrote: normpath will convert forward slashes to backslashes on WinXX systems, but does not seem to do the reverse on posix systems...so try changing your string to use forward slashes.  Also- is the path otherwise the same on your Linux

Re: Broken pipe

2010-05-07 Thread Ron Eggler
-- Ron Eggler Suite# 1804 1122 Gilford St Vancouver, BC V6G 2P5 Canada (778) 230-9442 On Thu, May 6, 2010 at 11:11 PM, Ron Eggler ron.egg...@gmail.com wrote: On May 6, 2010 10:37:14 pm Chris Rebert wrote: On Thu, May 6, 2010 at 10:27 PM, cerr ron.egg...@gmail.com wrote: Hi There,

Re: Broken pipe

2010-05-07 Thread cerr
On May 7, 9:45 am, Ron Eggler ron.egg...@gmail.com wrote: -- Ron Eggler Suite# 1804 1122 Gilford St Vancouver, BC V6G 2P5 Canada (778) 230-9442 On Thu, May 6, 2010 at 11:11 PM, Ron Eggler ron.egg...@gmail.com wrote: On May 6, 2010 10:37:14 pm Chris Rebert wrote: On Thu, May 6,

Frustration debugging serial code

2010-05-07 Thread William R. Wing (Bill Wing)
Hello World - I'm new to both Python and this list, but here's hoping someone can spot my problem. System: Mac OS-X, 10.6.3 (Intel dual quad processor) Using Python 2.6.1, and pyserial-2.5_rc2-py2.6 The following snippet of code is designed to open a port via a KeySpan USB-to-serial converter

Re: Frustration debugging serial code

2010-05-07 Thread MRAB
William R. Wing (Bill Wing) wrote: Hello World - I'm new to both Python and this list, but here's hoping someone can spot my problem. System: Mac OS-X, 10.6.3 (Intel dual quad processor) Using Python 2.6.1, and pyserial-2.5_rc2-py2.6 The following snippet of code is designed to open a port

Re: Windows - select.select, timeout and KeyboardInterrupt

2010-05-07 Thread Antoine Pitrou
Le Fri, 07 May 2010 16:36:44 +0200, Giampaolo Rodolà a écrit : You can easily avoid this by setting a lower timeout when calling asyncore.loop(), like 1 second or less (for example, Twisted uses 0.001 secs). Actually there's no reason for asyncore to have such a high default timeout (30

Help running Windows programs from Python

2010-05-07 Thread Scott
I want to write a script to automate log archiving/compressing on a Win2003 server. I have Python 2.6 installed. I am planning to use 7- zip for compression (because I have been using it manually for a while now). For now all operations will be local in the C: drive. As a total beginner I'm

Re: Frustration debugging serial code

2010-05-07 Thread MRAB
William R. Wing (Bill Wing) wrote: On May 7, 2010, at 2:08 PM, MRAB wrote: William R. Wing (Bill Wing) wrote: Hello World - I'm new to both Python and this list, but here's hoping someone can spot my problem. System: Mac OS-X, 10.6.3 (Intel dual quad processor) Using Python 2.6.1, and

Re: Windows - select.select, timeout and KeyboardInterrupt

2010-05-07 Thread Paul Moore
On 7 May 2010 15:36, Giampaolo Rodolà g.rod...@gmail.com wrote: You can easily avoid this by setting a lower timeout when calling asyncore.loop(), like 1 second or less (for example, Twisted uses 0.001 secs). Thanks, that's what I was considering. Actually there's no reason for asyncore to

Re: Frustration debugging serial code

2010-05-07 Thread William R. Wing
On May 7, 2010, at 2:08 PM, MRAB wrote: William R. Wing (Bill Wing) wrote: Hello World - I'm new to both Python and this list, but here's hoping someone can spot my problem. System: Mac OS-X, 10.6.3 (Intel dual quad processor) Using Python 2.6.1, and pyserial-2.5_rc2-py2.6 The following

Re: Frustration debugging serial code

2010-05-07 Thread Grant Edwards
William R. Wing (Bill Wing) wrote: Hello World - I'm new to both Python and this list, but here's hoping someone can spot my problem. System: Mac OS-X, 10.6.3 (Intel dual quad processor) Using Python 2.6.1, and pyserial-2.5_rc2-py2.6 The following snippet of code is designed to open a

Re: Frustration debugging serial code

2010-05-07 Thread Grant Edwards
On 2010-05-07, Grant Edwards inva...@invalid.invalid wrote: William R. Wing (Bill Wing) wrote: Hello World - I'm new to both Python and this list, but here's hoping someone can spot my problem. System: Mac OS-X, 10.6.3 (Intel dual quad processor) Using Python 2.6.1, and

Re: Windows - select.select, timeout and KeyboardInterrupt

2010-05-07 Thread Giampaolo Rodolà
2010/5/7 Antoine Pitrou solip...@pitrou.net: Le Fri, 07 May 2010 16:36:44 +0200, Giampaolo Rodolà a écrit : You can easily avoid this by setting a lower timeout when calling asyncore.loop(), like 1 second or less (for example, Twisted uses 0.001 secs). Actually there's no reason for asyncore

ConfigParser.get() defaults?

2010-05-07 Thread Tim Chase
With a normal dictionary, I can specify a default fallback value in the event the requested key isn't present: d = {} print d.get(42, 'Some default goes here') However, with the ConfigParser object, there doesn't seem to be any way to do a similar cp = ConfigParser(...) # ...

Re: Help running Windows programs from Python

2010-05-07 Thread Mensanator
On May 7, 2:14 pm, Scott scott.freem...@gmail.com wrote: I want to write a script to automate log archiving/compressing on a Win2003 server. I have Python 2.6 installed. I am planning to use 7- zip for compression (because I have been using it manually for a while now). For now all operations

Re: Frustration debugging serial code

2010-05-07 Thread J. Cliff Dyer
On Fri, 2010-05-07 at 15:36 -0400, William R. Wing wrote: Maybe I should have been more explicit. The first line in the Python file is: #!/usr/bin/env Python (alternatively #!/usr/bin/Python - same results either way). python should be lowercased when referring to the name of the

Re: Frustration debugging serial code

2010-05-07 Thread J. Cliff Dyer
On Fri, 2010-05-07 at 15:36 -0400, William R. Wing wrote: Maybe I should have been more explicit. The first line in the Python file is: #!/usr/bin/env Python (alternatively #!/usr/bin/Python - same results either way). python should be lowercased when referring to the name of the

Re: Help running Windows programs from Python

2010-05-07 Thread j vickroy
Scott wrote: I want to write a script to automate log archiving/compressing on a Win2003 server. I have Python 2.6 installed. I am planning to use 7- zip for compression (because I have been using it manually for a while now). For now all operations will be local in the C: drive. As a total

Re: Windows - select.select, timeout and KeyboardInterrupt

2010-05-07 Thread Antoine Pitrou
Le Fri, 07 May 2010 21:55:15 +0200, Giampaolo Rodolà a écrit : Of course, but 30 seconds look a little bit too much to me, also because (I might be wrong here) I noticed that a smaller timeout seems to result in better performances. That's probably bogus. Plus, if scheduled callbacks are

Re: List comprehension + lambdas - strange behaviour

2010-05-07 Thread Terry Reedy
On 5/7/2010 8:31 AM, Neil Cerutti wrote: On 2010-05-07, Terry Reedytjre...@udel.edu wrote: On 5/6/2010 3:34 PM, Artur Siekielski wrote: Hello. I found this strange behaviour of lambdas, closures and list comprehensions: funs = [lambda: x for x in range(5)] [f() for f in funs] [4, 4, 4, 4,

Re: idiomatic way to collect and report multiple exceptions?

2010-05-07 Thread Aahz
In article mailman.2715.1273204222.23598.python-l...@python.org, Ben Cohen nco...@ucsd.edu wrote: eg -- I'd like to do something like this: errors = [] for item in data: try: process(item) except ValidationError as e: errors.append(e) raise

Re: Extract a bordered, skewed rectangle from an image

2010-05-07 Thread David Bolen
Paul Hemans dar...@nowhere.com writes: I am wondering whether there are any people here that have experience with openCV and Python. If so, could you either give me some pointers on how to approach this, or if you feel so inclined, bid on the project. There are 2 problems: Can't offer

Re: ConfigParser.get() defaults?

2010-05-07 Thread Jon Clements
On 7 May, 21:05, Tim Chase python.l...@tim.thechases.com wrote: With a normal dictionary, I can specify a default fallback value in the event the requested key isn't present:    d = {}    print d.get(42, 'Some default goes here') However, with the ConfigParser object, there doesn't seem to

Re: Fast Efficient way to transfer an object to another list

2010-05-07 Thread Bryan
Gabriel Genellina wrote: I'd do that in two steps: def transfer_stock(stock_code, old_list, new_list):    # find the indexes to transfer    indexes = [i for i,stock in enumerate(old_list)               if stock.code==stock_code]    # actually transfer them    for index in

Re: Picking a license

2010-05-07 Thread Ben Finney
Patrick Maupin pmau...@gmail.com writes: On May 6, 6:56 pm, Ben Finney ben+pyt...@benfinney.id.au wrote: Er, no. Anyone who thinks that a copyleft license “forces” anyone to do anything is mistaken about copyright law Perhaps you feel forces is too loaded of a word. There is no question,

Re: Picking a license

2010-05-07 Thread Patrick Maupin
On May 7, 5:33 pm, Ben Finney ben+pyt...@benfinney.id.au wrote: Patrick Maupin pmau...@gmail.com writes: On May 6, 6:56 pm, Ben Finney ben+pyt...@benfinney.id.au wrote: Er, no. Anyone who thinks that a copyleft license “forces” anyone to do anything is mistaken about copyright law

Re: Picking a license

2010-05-07 Thread Ben Finney
Patrick Maupin pmau...@gmail.com writes: On May 7, 5:33 pm, Ben Finney ben+pyt...@benfinney.id.au wrote: Since no-one is forcing anyone to take any of the actions permitted in the license, and since those actions would not otherwise be permitted under copyright law, it's both false and

Re: ConfigParser.get() defaults?

2010-05-07 Thread Steven D'Aprano
On Fri, 07 May 2010 15:05:53 -0500, Tim Chase wrote: With a normal dictionary, I can specify a default fallback value in the event the requested key isn't present: [...] However, with the ConfigParser object, there doesn't seem to be any way to do a similar [...] Sounds like a nice feature

Re: idiomatic way to collect and report multiple exceptions?

2010-05-07 Thread Ben Cohen
Many thanks for the excellent example!! You rock! Ben On May 6, 2010, at 10:56 PM, Chris Rebert wrote: On Thu, May 6, 2010 at 8:50 PM, Ben Cohen nco...@ucsd.edu wrote: Is there a pythonic way to collect and display multiple exceptions at the same time? For example let's say you're

Re: idiomatic way to collect and report multiple exceptions?

2010-05-07 Thread Steven D'Aprano
On Fri, 07 May 2010 14:28:05 -0700, Aahz wrote: In article mailman.2715.1273204222.23598.python-l...@python.org, Ben Cohen nco...@ucsd.edu wrote: eg -- I'd like to do something like this: errors = [] for item in data: try: process(item) except ValidationError as e:

Re: idiomatic way to collect and report multiple exceptions?

2010-05-07 Thread Chris Rebert
On May 6, 2010, at 10:56 PM, Chris Rebert wrote: On Thu, May 6, 2010 at 8:50 PM, Ben Cohen nco...@ucsd.edu wrote: Is there a pythonic way to collect and display multiple exceptions at the same time? For example let's say you're trying to validate the elements of a list and you'd like to

Re: Frustration debugging serial code

2010-05-07 Thread William R. Wing (Bill Wing)
See comments in-line. On May 7, 2010, at 3:23 PM, MRAB wrote: William R. Wing (Bill Wing) wrote: On May 7, 2010, at 2:08 PM, MRAB wrote: William R. Wing (Bill Wing) wrote: Hello World - I'm new to both Python and this list, but here's hoping someone can spot my problem. System: Mac

Re: Frustration debugging serial code

2010-05-07 Thread William R. Wing (Bill Wing)
On May 7, 2010, at 4:12 PM, J. Cliff Dyer wrote: On Fri, 2010-05-07 at 15:36 -0400, William R. Wing wrote: Maybe I should have been more explicit. The first line in the Python file is: #!/usr/bin/env Python (alternatively #!/usr/bin/Python - same results either way). python

Re: Help running Windows programs from Python

2010-05-07 Thread John Yeung
On May 7, 3:14 pm, Scott scott.freem...@gmail.com wrote: I want to write a script to automate log archiving/compressing on a Win2003 server. I have Python 2.6 installed. I am planning to use 7- zip for compression (because I have been using it manually for a while now). For now all operations

Re: ConfigParser.get() defaults?

2010-05-07 Thread Tim Chase
On 05/07/2010 07:56 PM, Steven D'Aprano wrote: On Fri, 07 May 2010 15:05:53 -0500, Tim Chase wrote: With a normal dictionary, I can specify a default fallback value in the event the requested key isn't present: [...] However, with the ConfigParser object, there doesn't seem to be any way to

is there a functional assert(x==y, 'error msg')

2010-05-07 Thread Vincent Davis
Is there a functional assert(x==y, 'error msg') ? I can only find the assert that is used like; assert x==y, 'error msg' *Vincent Davis 720-301-3003 * vinc...@vincentdavis.net my blog http://vincentdavis.net | LinkedInhttp://www.linkedin.com/in/vincentdavis --

Re: Frustration debugging serial code

2010-05-07 Thread MRAB
William R. Wing (Bill Wing) wrote: See comments in-line. On May 7, 2010, at 3:23 PM, MRAB wrote: William R. Wing (Bill Wing) wrote: On May 7, 2010, at 2:08 PM, MRAB wrote: William R. Wing (Bill Wing) wrote: Hello World - I'm new to both Python and this list, but here's hoping someone can

Re: is there a functional assert(x==y, 'error msg')

2010-05-07 Thread James Mills
On Sat, May 8, 2010 at 12:04 PM, Vincent Davis vinc...@vincentdavis.netwrote: Is there a functional assert(x==y, 'error msg') ? I can only find the assert that is used like; assert x==y, 'error msg' What about: def assertfunc(expr, msg): assert expr, msg cheers James --

Re: Frustration debugging serial code

2010-05-07 Thread William R. Wing (Bill Wing)
On May 7, 2010, at 10:18 PM, MRAB wrote: William R. Wing (Bill Wing) wrote: See comments in-line. On May 7, 2010, at 3:23 PM, MRAB wrote: William R. Wing (Bill Wing) wrote: On May 7, 2010, at 2:08 PM, MRAB wrote: [byte -byte- byte] The X10 controller not only receives it, it echos the

Re: is there a functional assert(x==y, 'error msg')

2010-05-07 Thread Vincent Davis
On Fri, May 7, 2010 at 8:38 PM, James Mills prolo...@shortcircuit.net.auwrote: On Sat, May 8, 2010 at 12:04 PM, Vincent Davis vinc...@vincentdavis.netwrote: Is there a functional assert(x==y, 'error msg') ? I can only find the assert that is used like; assert x==y, 'error msg' What

Re: Frustration debugging serial code

2010-05-07 Thread MRAB
William R. Wing (Bill Wing) wrote: On May 7, 2010, at 10:18 PM, MRAB wrote: William R. Wing (Bill Wing) wrote: See comments in-line. On May 7, 2010, at 3:23 PM, MRAB wrote: William R. Wing (Bill Wing) wrote: On May 7, 2010, at 2:08 PM, MRAB wrote: [byte -byte- byte] The X10 controller

Re: recursive converting object to string which hasn't __str__ or/and__repr__

2010-05-07 Thread Lie Ryan
On 05/06/10 14:40, Daneel Yaitskov wrote: Hi, Everybody knows class's __str__ and __repr__ can be used to get readable user representation of an object. But for simple classes or debug aims it is tediously to code these methods. And Python has very powerful reflection. I believe

Re: Windows - select.select, timeout and KeyboardInterrupt

2010-05-07 Thread exarkun
On 7 May, 07:25 pm, p.f.mo...@gmail.com wrote: On 7 May 2010 15:36, Giampaolo Rodol� g.rod...@gmail.com wrote: You can easily avoid this by setting a lower timeout when calling asyncore.loop(), like 1 second or less (for example, Twisted uses 0.001 secs). Thanks, that's what I was

Re: Teaching Programming

2010-05-07 Thread Gregory Ewing
alex23 wrote: This is my biggest issue with Knuth's view of literate programming. If the generated source isn't readable, am I just supposed to trust it? How can I tell if an error lies in my expression of the algorithm or in the code generation itself? Knuth would say that the code generator

Re: unable to get Hudson to run unit tests

2010-05-07 Thread Stefan Behnel
j vickroy, 07.05.2010 20:44: I apologize if this is not the appropriate forum for a question about Hudson (http://hudson-ci.org/), but I did not know where else to ask and my web searches have not been fruitful. Certainly nice to read something about Hudson in this forum, which is rare

Re: idiomatic way to collect and report multiple exceptions?

2010-05-07 Thread Ben Cohen
Apologies for the TABs -- I wrote that example for demonstration purposes in my mail client -- I'll copy and paste from a real code editor in the future. Ben On May 7, 2010, at 3:28 PM, Aahz wrote: In article mailman.2715.1273204222.23598.python-l...@python.org, Ben Cohen nco...@ucsd.edu

[issue8641] IDLE 3 doesn't highlights b, but u

2010-05-07 Thread Puzzlet Chung
New submission from Puzzlet Chung puzz...@gmail.com: IDLE 3.1.2 doesn't highlight b syntax, instead highlights u. Tested with IDLE (x86) 3.1.2 and Windows XP SP2. -- components: IDLE messages: 105184 nosy: puzzlet priority: normal severity: normal status: open title: IDLE 3 doesn't

[issue2574] Add RFC 3768 SSM Multicast support to socket

2010-05-07 Thread Jean-Paul Calderone
Changes by Jean-Paul Calderone exar...@twistedmatrix.com: -- keywords: +needs review status: open - languishing versions: +Python 3.2 -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2574

[issue8354] siginterrupt with flag=False is reset when signal received

2010-05-07 Thread Jean-Paul Calderone
Jean-Paul Calderone exar...@twistedmatrix.com added the comment: I agree that this should be landed (for 2.6 and 2.7). I think I can do it. I made some changes to the tests, though. It would be nice for someone to look those over and make sure the change still looks good. I checked

[issue8571] zlib causes a SystemError when decompressing a chunk 1GB

2010-05-07 Thread Sreejith Madhavan
Sreejith Madhavan sreeji...@gmx.com added the comment: Attached a patch for Modules/zlibmodule.c that worked for me. Tested with python (2.6.1 and 2.6.5) 64bit builds on Solaris (amd64 and sparc) and RHEL5.2 amd64. -- keywords: +patch nosy: +Sreejith.Madhavan Added file:

[issue8642] json.loads description

2010-05-07 Thread MATSUI Tetsushi
New submission from MATSUI Tetsushi m...@users.sourceforge.net: At the end of description of json.loads, dump() should be load(). -- assignee: d...@python components: Documentation messages: 105187 nosy: d...@python, mft priority: normal severity: normal status: open title: json.loads

[issue8610] Python3/POSIX: errors if file system encoding is None

2010-05-07 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: STINNER Victor wrote: STINNER Victor victor.stin...@haypocalc.com added the comment: I think that using ASCII is a safer choice in case of errors. (...) Ouch, that was a poor choice. Ok, you conviced me with your PYTHONFSENCODING

[issue8610] Python3/POSIX: errors if file system encoding is None

2010-05-07 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Le vendredi 07 mai 2010 11:19:52, vous avez écrit : Ok, you conviced me with your PYTHONFSENCODING suggestion (#8622). Can you review my last patch please? I don't think we can change the fallback encoding in 3.2. But you can

[issue8610] Python3/POSIX: errors if file system encoding is None

2010-05-07 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: Added file: http://bugs.python.org/file17244/initfsencoding-3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8610 ___

[issue8610] Python3/POSIX: errors if file system encoding is None

2010-05-07 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: Removed file: http://bugs.python.org/file17242/initfsencoding-2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8610 ___

[issue8643] incorrect timedelta yielded by two on-the-fly nows

2010-05-07 Thread Michal Božoň
New submission from Michal Božoň michal.bo...@gmail.com: now() - now() from datetime.datetime produces not-nearly-zero timedelta: import datetime (datetime.datetime.now() - datetime.datetime.now()).seconds 86399 (i can't in the moment figure out why this is happening, sice the datetime

[issue8638] Remove suggestion for name mangling from the tutorial

2010-05-07 Thread Skip Montanaro
Skip Montanaro s...@pobox.com added the comment: Maybe the wording should be changed, but name mangling serves a useful purpose. There are two definitions of private which seem to be a bit conflated in this section: * private as in, this name is not part of the public API - use it at your

[issue8571] zlib causes a SystemError when decompressing a chunk 1GB

2010-05-07 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- versions: +Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8571 ___ ___ Python-bugs-list

[issue8643] incorrect timedelta yielded by two on-the-fly nows subtraction

2010-05-07 Thread Michal Božoň
Michal Božoň michal.bo...@gmail.com added the comment: ok, my fault, i should have tried (abs(datetime.datetime.now() - datetime.datetime.now())).seconds 0 sorry :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8643

[issue8610] Python3/POSIX: errors if file system encoding is None

2010-05-07 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: STINNER Victor wrote: +codec = _PyCodec_Lookup(Py_FileSystemDefaultEncoding); +if (!codec) { +Py_FatalError( +Py_Initialize: unable to load the file system codec); It's better to use the same

[issue8643] incorrect timedelta yielded by two on-the-fly nows subtraction

2010-05-07 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Hmm. My example did make me realize that the total_seconds() method isn't as accurate as it could be. I'll open another issue for this. -- ___ Python tracker rep...@bugs.python.org

[issue8644] timedelta.total_seconds needlessly inaccurate, especially for negative timedeltas

2010-05-07 Thread Mark Dickinson
New submission from Mark Dickinson dicki...@gmail.com: I just noticed (while responding to issue 8643) that timedelta.total_seconds() has some accuracy problems, especially for negative timedeltas: Python 3.2a0 (py3k:80840:80842, May 7 2010, 12:29:35) [GCC 4.2.1 (Apple Inc. build 5659)] on

[issue8644] timedelta.total_seconds needlessly inaccurate, especially for negative timedeltas

2010-05-07 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: P.S. This change would also make total_seconds() consistent with division by timedelta(seconds=1): td / timedelta(seconds=1) -0.000123 In fact, this might even be a good way to re-implement total_seconds internally. --

  1   2   >