Wing IDE 3.2.12 released

2010-12-01 Thread Wingware
Hi, Wingware has released version 3.2.12 of Wing IDE, an integrated development environment designed specifically for the Python programming language. This release includes the following improvements: * Support for Stackless version 2.7 * Correctly ignore exceptions in debugger for logged

Iran slams Wiki-release as US psywar - WIKILEAKS is replacing those BIN LADEN communiques of CIA (the global ELITE) intended to threaten MASSES

2010-12-01 Thread small Pox
Iran slams Wiki-release as US psywar - WIKILEAKS is replacing those BIN LADEN communiques of CIA (the global ELITE) intended to threaten MASSES CIA is the criminal agency of the global elite. They want to destroy the middle class from the planet and also create a global tyranny of a police

Re: Python 3 encoding question: Read a filename from stdin, subsequently open that filename

2010-12-01 Thread Nobody
On Wed, 01 Dec 2010 02:14:09 +, MRAB wrote: If the filenames are to be shown to a user then there needs to be a mapping between bytes and glyphs. That's an encoding. If different users use different encodings then exchange of textual data becomes difficult. OTOH, the exchange of binary

Re: Catching user switching and getting current active user from root on linux

2010-12-01 Thread Tim Golden
On 30/11/2010 22:47, mpnordland wrote: I have situation where I need to be able to get the current active user, and catch user switching eg user1 locks screen, leaves computer, user2 comes, and logs on. basically, when there is any type of user switch my script needs to know. If it's Windows

Re: Change one list item in place

2010-12-01 Thread Steven D'Aprano
On Tue, 30 Nov 2010 17:08:57 -0800, Gnarlodious wrote: This works for me: def sendList(): return [item0, item1] def query(): l=sendList() return [Formatting only {0} into a string.format(l[0]), l[1]] For the record, you're not actually changing a list in place, you're

Re: SAX unicode and ascii parsing problem

2010-12-01 Thread Ulrich Eckhardt
goldtech wrote: I tried this but nothing changed, I thought this might convert it and then I'd paerse the new file - didn't work: uc = open(r'E:\sc\ppb4.xml').read().decode('utf8') ascii = uc.decode('ascii') mex9 = open( r'E:\scrapes\ppb5.xml', 'w' ) mex9.write(ascii) This doesn't make

Re: Python 3 encoding question: Read a filename from stdin, subsequently open that filename

2010-12-01 Thread Antoine Pitrou
On Tue, 30 Nov 2010 16:57:57 -0800 Dan Stromberg drsali...@gmail.com wrote: --- On Tue, 11/30/10, Dan Stromberg drsali...@gmail.com wrote: In Python 3, I'm finding that I have encoding issues with characters with their high bit set.  Things are fine with strictly ASCII filenames. 

Re: Change one list item in place

2010-12-01 Thread Steven D'Aprano
On Wed, 01 Dec 2010 08:54:49 +, Steven D'Aprano wrote: An alternative would be: Please ignore. That was an accidental Send mid-edit. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3 encoding question: Read a filename from stdin, subsequently open that filename

2010-12-01 Thread Antoine Pitrou
On Tue, 30 Nov 2010 22:22:01 -0500 Albert Hopkins mar...@letterboxes.org wrote: And I can freely copy these invalid files across different (Unix) systems, because the OS doesn't care about encoding. And so can Python, thanks to PEP 383. That's where encodings which can be used globally

Re: To Thread or not to Thread....?

2010-12-01 Thread Antoine Pitrou
On Wed, 1 Dec 2010 02:45:50 + Jack Keegan whatsjacksem...@gmail.com wrote: Hi there, I'm currently writing an application to control and take measurements during an experiments. This is to be done on an embedded computer running XPe so I am happy to have python available, although I am

Re: Programming games in historical linguistics with Python

2010-12-01 Thread Steven D'Aprano
On Tue, 30 Nov 2010 07:03:28 -0800, Dax Bloom wrote: Is there a way to refer to vowels and consonants as a subcategory of text? Is there a function to remove all vowels? How should one create and order the dictionary file for the rules? How to chain several transformations automatically from

Re: Python 3 encoding question: Read a filename from stdin, subsequently open that filename

2010-12-01 Thread Peter Otten
Nobody wrote: Python 3.x's decision to treat filenames (and environment variables) as text even on Unix is, in short, a bug. One which, IMNSHO, will mean that Python 2.x is still around when Python 4 is released. For filenames in Python 3 the user has the choice between text (str) and bytes.

Login using usrllib2

2010-12-01 Thread dudeja . rajat
Hi All, I'm using urllib2 module to login to an https server. However I'm unable to login as the password is not getting accepted. Here is the code: import urllib2, urllib values={'Username': 'admin', 'Password': 'admin123'} url='https://172.25.17.20:9443' data = urllib.urlencode(values)

Re: Login using usrllib2

2010-12-01 Thread Chris Rebert
On Wed, Dec 1, 2010 at 1:53 AM, dudeja.ra...@gmail.com wrote: Hi All, I'm using urllib2 module to login to an https server. However I'm unable to login as the password is not getting accepted. Here is the code: import urllib2, urllib values={'Username': 'admin', 'Password': 'admin123'}

Re: To Thread or not to Thread....?

2010-12-01 Thread Jack Keegan
Hi Antoine, On Wed, Dec 1, 2010 at 9:24 AM, Antoine Pitrou solip...@pitrou.net wrote: The main question IMO: the I2C bus operates at 400kHz, but how much received data can it buffer? That will give you a hint as to how much latency you can tolerate. I'm not sure on buffering, but I have to

Re: To Thread or not to Thread....?

2010-12-01 Thread Antoine Pitrou
On Wed, 1 Dec 2010 11:50:46 + Jack Keegan whatsjacksem...@gmail.com wrote: Hi Antoine, On Wed, Dec 1, 2010 at 9:24 AM, Antoine Pitrou solip...@pitrou.net wrote: The main question IMO: the I2C bus operates at 400kHz, but how much received data can it buffer? That will give you a

RE: Reading by positions plain text files

2010-12-01 Thread Javier Van Dam
Ok. I will try it and let you know. Thanks a lot!! J Date: Tue, 30 Nov 2010 20:32:56 -0600 From: python.l...@tim.thechases.com To: javiervan...@gmail.com CC: python-list@python.org Subject: Re: Reading by positions plain text files On 11/30/2010 08:03 PM, javivd wrote: On Nov 30,

SFTP: max bytes to be transferred

2010-12-01 Thread Dario Beraldi
Hello, I'm using the module paramiko to transfer files via sftp (see code below). I would like to specify the maximum amount of bytes to be transferred (say 10MB, if the file is bigger just transfer up to these many bytes). From the docs of paramiko

Re: Change one list item in place

2010-12-01 Thread Jean-Michel Pichavant
Gnarlodious wrote: This works for me: def sendList(): return [item0, item1] def query(): l=sendList() return [Formatting only {0} into a string.format(l[0]), l[1]] query() However, is there a way to bypass the l=sendList() and change one list item in-place? Possibly a list

Re: SAX unicode and ascii parsing problem

2010-12-01 Thread Adam Tauno Williams
On Tue, 2010-11-30 at 12:28 -0800, goldtech wrote: I'm trying to parse an xml file using SAX. About half-way through a file I get this error: Traceback (most recent call last): File C:\Python26\Lib\site-packages\pythonwin\pywin\framework \scriptutils.py, line 325, in RunScript exec

Re: Change one list item in place

2010-12-01 Thread Gnarlodious
On Dec 1, 6:23 am, Jean-Michel Pichavant jeanmic...@sequans.com wrote: what about def query():     return [Formating only {0} into a string.format(sendList()[0])] + sendList()[1:] However this solution calls sendList() twice, which is too processor intensive. Thanks for all the ideas, I've

Re: To Thread or not to Thread....?

2010-12-01 Thread James Mills
Surely I2C is just a serial-like interface and one should be able to do async I/O on it ? The use of threads is not necessary here and the GIL doesn't become a problem in async I/O anyway. I only use threads for operating that might block (not for I/O). cheers James On Wed, Dec 1, 2010 at 7:24

strange TypeError exception in function compiled from a string

2010-12-01 Thread nelson
Hi all, I have this function, defined in a string and ecetuted through ad exec call def cell1(d): x=d.get('x') print x import y return y.add(y.add(self.adf0(x),self.adf0(x)),self.adf0(x)) d is a dict of this kind {'x':2} I receive the following exception, that i find very

Re: How to initialize each multithreading Pool worker with an individual value?

2010-12-01 Thread Valery Khamenya
Hi Dan, If you create in the parent a queue in shared memory (multiprocessing facilitates this nicely), and fill that queue with the values in your ports tuple, then you could have each child in the worker pool extract a single value from this queue so each worker can have its own, unique

Re: Change one list item in place

2010-12-01 Thread Jean-Michel Pichavant
Gnarlodious wrote: On Dec 1, 6:23 am, Jean-Michel Pichavant jeanmic...@sequans.com wrote: what about def query(): return [Formating only {0} into a string.format(sendList()[0])] + sendList()[1:] However this solution calls sendList() twice, which is too processor intensive.

Re: strange TypeError exception in function compiled from a string

2010-12-01 Thread bruno.desthuilli...@gmail.com
On 1 déc, 14:48, nelson nelson1...@gmail.com wrote: Hi all,   I have this function, defined in a string and ecetuted through ad exec call def cell1(d):     x=d.get('x')     print x     import y     return y.add(y.add(self.adf0(x),self.adf0(x)),self.adf0(x)) d is a dict of this kind

position independent build of python

2010-12-01 Thread erikj
Hi, If my understanding is correct, the sys.prefix variable holds the root directory python uses to find related files, and eg its site-packages. the value of sys.prefix is specified at compile time. it seems that on windows, when I build/install python at one location, and later move it to

Re: To Thread or not to Thread....?

2010-12-01 Thread Werner Thie
Hi I see quite a few alleys to go down when stuck with such types of problems, but instead of listing and discussing them have a look at a quite complete discussion and comparison of the various async programming options available at http://syncless.googlecode.com Also have a look at the

When to use codecs vs. io module (Python 2.7 and higher)

2010-12-01 Thread python
Python 2.7 or higher: Looking for reasons/scenarios where one should use the codecs vs. io module. Are there use cases that favor one specific module over the other module? My understanding is that the io module is much faster than the codecs module (and can be used interchangably), but the

Re: To Thread or not to Thread....?

2010-12-01 Thread Antoine Pitrou
On Wed, 1 Dec 2010 23:48:38 +1000 James Mills prolo...@shortcircuit.net.au wrote: Surely I2C is just a serial-like interface and one should be able to do async I/O on it ? The use of threads is not necessary here and the GIL doesn't become a problem in async I/O anyway. Well, you are

Re: When to use codecs vs. io module (Python 2.7 and higher)

2010-12-01 Thread Antoine Pitrou
On Wed, 01 Dec 2010 09:55:01 -0500 pyt...@bdurham.com wrote: Python 2.7 or higher: Looking for reasons/scenarios where one should use the codecs vs. io module. Are there use cases that favor one specific module over the other module? My understanding is that the io module is much faster

Re: Catching user switching and getting current active user from root on linux

2010-12-01 Thread Grant Edwards
On 2010-11-30, mpnordland mpnordl...@gmail.com wrote: I have situation where I need to be able to get the current active user, How do you define current active user? and catch user switching eg user1 locks screen, leaves computer, user2 comes, and logs on. basically, when there is any type

Decorate un Frame with window managers title bar, etc en Tkinter 8.5

2010-12-01 Thread craf
Hi. I use python 3.1 and Tkinter 8.5 in Ubuntu 9.10 I would like to turn a frame into a toolbox, ,and for that I read that you can use the command wm manage (window) The information can be found at: http://www.tcl.tk/man/tcl8.5/TkCmd/wm.htm#M39 the explanation says: wm manage widget:

Wing IDE 3.2.12 released

2010-12-01 Thread Wingware
Hi, Wingware has released version 3.2.12 of Wing IDE, an integrated development environment designed specifically for the Python programming language. This release includes the following improvements: * Support for Stackless version 2.7 * Correctly ignore exceptions in debugger for logged

Python's equivalent to Main calling program and subprograms

2010-12-01 Thread goldtech
Hi, Could someone link me to info - I'm sure this is commonly done: Long ago with Fortran and Pascal there was a pattern used a lot. It was like: Start Main Global Var Subprogram1 Subprogram2 Subprogram3 End of Main End The global var was a var that all the subprograms could

Re: Python's equivalent to Main calling program and subprograms

2010-12-01 Thread Tim Harig
On 2010-12-01, goldtech goldt...@worldpost.com wrote: Start Main Global Var Subprogram1 Subprogram2 Subprogram3 End of Main End module_wide_var = value def Subprogram1: # code def Subprogram2: # code def Subprogram3: # code def main:

Re: Python's equivalent to Main calling program and subprograms

2010-12-01 Thread Jean-Michel Pichavant
Tim Harig wrote: On 2010-12-01, goldtech goldt...@worldpost.com wrote: Start Main Global Var Subprogram1 Subprogram2 Subprogram3 End of Main End module_wide_var = value def Subprogram1: # code def Subprogram2: # code def Subprogram3: # code

Re: Login using usrllib2

2010-12-01 Thread Jon Clements
On Dec 1, 10:16 am, Chris Rebert c...@rebertia.com wrote: On Wed, Dec 1, 2010 at 1:53 AM,  dudeja.ra...@gmail.com wrote: Hi All, I'm using urllib2 module to login to an https server. However I'm unable to login as the password is not getting accepted. Here is the code: import

RE: Python's equivalent to Main calling program and subprograms

2010-12-01 Thread m b
if __name__ == __main__: main() What does this mean? /Mikael -- http://mail.python.org/mailman/listinfo/python-list

Re: strange TypeError exception in function compiled from a string

2010-12-01 Thread MRAB
On 01/12/2010 13:48, nelson wrote: Hi all, I have this function, defined in a string and ecetuted through ad exec call def cell1(d): x=d.get('x') print x import y return y.add(y.add(self.adf0(x),self.adf0(x)),self.adf0(x)) d is a dict of this kind {'x':2} I receive

Re: Python's equivalent to Main calling program and subprograms

2010-12-01 Thread Chris Rebert
On Wed, Dec 1, 2010 at 9:08 AM, m b sn...@hotmail.se wrote: if __name__ == __main__: main() What does this mean? See http://effbot.org/pyfaq/tutor-what-is-if-name-main-for.htm (which is the 3rd Google hit for __main__) Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's equivalent to Main calling program and subprograms

2010-12-01 Thread Jean-Michel Pichavant
m b wrote: if __name__ == __main__: main() What does this mean? /Mikael __name__ is an attribute of the module. Usually it is set to the module name, except when the module is acutally executed as the entry point, in that case __name__ is set to '__main__'. foo.py: print __name__

Re: Python's equivalent to Main calling program and subprograms

2010-12-01 Thread Benjamin Kaplan
On Wed, Dec 1, 2010 at 12:08 PM, m b sn...@hotmail.se wrote: if __name__ == __main__: main() What does this mean? /Mikael Every module has an attribute called __name__. Normally, it's the name of the module itself. However, the module being run as a script (rather than imported) is

Re: Python's equivalent to Main calling program and subprograms

2010-12-01 Thread Hanif Jameel
On 01/12/2010 17:08, m b wrote: if __name__ == __main__: main() What does this mean? /Mikael Python will not cause the main() function to run automatically when you execute the script, it has to be called. __name__ is a special variable which is set by the python interpreter

Re: Regarding searching directory and to delete it with specific pattern.

2010-12-01 Thread MRAB
On 01/12/2010 07:07, Ramprakash Jelari thinakaran wrote: Hi all, Would like to search list of directories with specific pattern and delete it?.. How can i do it?. Example: in /home/jpr/ i have the following list of directories. 1.2.3-2, 1.2.3-10, 1.2.3-8, i would like to delete the directories

Re: Python's equivalent to Main calling program and subprograms

2010-12-01 Thread Steve Holden
On 12/1/2010 12:08 PM, m b wrote: if __name__ == __main__: main() What does this mean? /Mikael It's a standard way of allowing programs to test themselves. When a module is imported its __name__ attribute us bound to the name of the module. When the module is run as a main

string find/replace

2010-12-01 Thread Carlo
Hello, I want the Python equivalent of the Perl expression: s/([a-z])([A-Z])/\1 \2/g In plain language: place a space between a lowercase and uppercase letter. I get lost in the RE module. Can someone help me? Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: string find/replace

2010-12-01 Thread Peter Otten
Carlo wrote: I want the Python equivalent of the Perl expression: s/([a-z])([A-Z])/\1 \2/g In plain language: place a space between a lowercase and uppercase letter. I get lost in the RE module. Can someone help me? import re re.compile(([a-z])([A-Z])).sub(r\1 \2, camelCase) 'camel Case'

Re: string find/replace

2010-12-01 Thread Donald O'Donnell
On Dec 1, 12:36 pm, Carlo ca...@somewhere.com wrote: Hello, I want the Python equivalent of the Perl expression: s/([a-z])([A-Z])/\1 \2/g In plain language: place a space between a lowercase and uppercase letter. I get lost in the RE module. Can someone help me? Thanks! This will also

Re: string find/replace

2010-12-01 Thread Carlo
On 2010-12-01, Peter Otten __pete...@web.de wrote: import re re.compile(([a-z])([A-Z])).sub(r\1 \2, camelCase) 'camel Case' Very simple if you know it. Thank you! -- http://mail.python.org/mailman/listinfo/python-list

Re: string find/replace

2010-12-01 Thread MRAB
On 01/12/2010 17:36, Carlo wrote: Hello, I want the Python equivalent of the Perl expression: s/([a-z])([A-Z])/\1 \2/g In plain language: place a space between a lowercase and uppercase letter. I get lost in the RE module. Can someone help me? That's easy: new_text =

Re: Catching user switching and getting current active user from root on linux

2010-12-01 Thread Mark Wooding
Grant Edwards inva...@invalid.invalid writes: On 2010-11-30, mpnordland mpnordl...@gmail.com wrote: and catch user switching eg user1 locks screen, leaves computer, user2 comes, and logs on. basically, when there is any type of user switch my script needs to know. What do you do when

Re: Python's equivalent to Main calling program and subprograms

2010-12-01 Thread Tim Harig
On Wed, Dec 1, 2010 at 9:08 AM, m b sn...@hotmail.se wrote: if __name__ == __main__: main() What does this mean? It is a Python idiom and a good practice. Strictly speaking it is unnecessary. Python doesn't recognize any functional initialization vector other then the start of the file.

Packages at Python.org

2010-12-01 Thread kirby.ur...@gmail.com
With Microsoft abandoning Visual FoxPro come 2015, we have 100K developers jumping ship (rough guess), perhaps to dot NET, but not necessarily.** This page is potentially getting a lot of hits (I'm not privy to the analytics): http://packages.python.org/dbf/ So how *do* you get source code

Re: Packages at Python.org

2010-12-01 Thread Chris Rebert
On Wed, Dec 1, 2010 at 12:38 PM, kirby.ur...@gmail.com kirby.ur...@gmail.com wrote: With Microsoft abandoning Visual FoxPro come 2015, we have 100K developers jumping ship (rough guess), perhaps to dot NET, but not necessarily.** This page is potentially getting a lot of hits (I'm not privy

Re: Packages at Python.org

2010-12-01 Thread Ian
On Dec 1, 1:38 pm, kirby.ur...@gmail.com kirby.ur...@gmail.com wrote: http://packages.python.org/dbf/ So how *do* you get source code from such a web place?  I'm not finding a tar ball or installer.  Sorry if I'm missing something obvious, like a link to Sourceforge. That site only

RE: Packages at Python.org

2010-12-01 Thread Dino Viehland
Kirby wrote: ** Unconfirmed rumors about IronPython leave me blog searching this afternoon. Still part of Codeplex? IronPython is still using CodePlex for bug tracking and posting releases but active development is now on GitHub w/ a Mercurial mirror. Jeff's blog has more info:

Re: Packages at Python.org

2010-12-01 Thread kirby.ur...@gmail.com
http://packages.python.org/dbf/ So how *do* you get source code from such a web place?  I'm not finding a tar ball or installer.  Sorry if I'm missing something obvious, like a link to Sourceforge. Thanks to very quick replies with pointers to http://pypi.python.org/pypi/dbf/ instead

Re: Packages at Python.org

2010-12-01 Thread Chris Rebert
On Wed, Dec 1, 2010 at 12:56 PM, kirby.ur...@gmail.com kirby.ur...@gmail.com wrote: http://packages.python.org/dbf/ So how *do* you get source code from such a web place?  I'm not finding a tar ball or installer.  Sorry if I'm missing something obvious, like a link to Sourceforge. Thanks

Re: Packages at Python.org

2010-12-01 Thread Robert Kern
On 12/1/10 2:56 PM, kirby.ur...@gmail.com wrote: http://packages.python.org/dbf/ So how *do* you get source code from such a web place? I'm not finding a tar ball or installer. Sorry if I'm missing something obvious, like a link to Sourceforge. Thanks to very quick replies with pointers

Re: Packages at Python.org

2010-12-01 Thread Jon Clements
On Dec 1, 8:56 pm, kirby.ur...@gmail.com kirby.ur...@gmail.com wrote: http://packages.python.org/dbf/ So how *do* you get source code from such a web place?  I'm not finding a tar ball or installer.  Sorry if I'm missing something obvious, like a link to Sourceforge. Thanks to very

Re: Packages at Python.org

2010-12-01 Thread python
You may want to take a look at Dabo http://dabodev.com/ +1 Malcolm -- http://mail.python.org/mailman/listinfo/python-list

multiple modules from single c extension

2010-12-01 Thread Eric Frederich
I have an extension to some C library that I created using the guide found here... http://docs.python.org/extending/extending.html I am starting to have A LOT of functions being wrapped. The library that I'm creating bindings for is organized into modules. In fact, all of their function

Re: Packages at Python.org

2010-12-01 Thread Ethan Furman
kirby.ur...@gmail.com wrote: With Microsoft abandoning Visual FoxPro come 2015, we have 100K developers jumping ship (rough guess), perhaps to dot NET, but not necessarily.** This page is potentially getting a lot of hits (I'm not privy to the analytics): http://packages.python.org/dbf/ The

Re: Change one list item in place

2010-12-01 Thread Steven D'Aprano
On Wed, 01 Dec 2010 05:33:55 -0800, Gnarlodious wrote: Thanks for all the ideas, I've resigned myself to unpacking a tuple and reassembling it. You make it sound like that's an onerous task. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3 encoding question: Read a filename from stdin, subsequently open that filename

2010-12-01 Thread Nobody
On Wed, 01 Dec 2010 10:34:24 +0100, Peter Otten wrote: Python 3.x's decision to treat filenames (and environment variables) as text even on Unix is, in short, a bug. One which, IMNSHO, will mean that Python 2.x is still around when Python 4 is released. For filenames in Python 3 the user

Re: Packages at Python.org

2010-12-01 Thread Jon Clements
On Dec 1, 10:32 pm, Ethan Furman et...@stoneleaf.us wrote: kirby.ur...@gmail.com wrote: With Microsoft abandoning Visual FoxPro come 2015, we have 100K developers jumping ship (rough guess), perhaps to dot NET, but not necessarily.** This page is potentially getting a lot of hits (I'm

Re: Some syntactic sugar proposals

2010-12-01 Thread Dmitry Groshev
On Nov 22, 2:21 pm, Andreas Löscher andreas.loesc...@s2005.tu- chemnitz.de wrote:     if x in range(a, b): #wrong! it feels so natural to check it that way, but we have to write     if a = x = b I understand that it's not a big deal, but it would be awesome to have some optimisations -

odd runtime error

2010-12-01 Thread David Brown
So I'm not subscribed to python-list but would like to get an answer to my question. I've made a small test program that dumps a RuntimeError and I'd like to know why. $ python test2.py doing stuff Traceback (most recent call last): File test2.py, line 3, in module import test RuntimeError:

I can't seem to change the timeout value on pexpect

2010-12-01 Thread chad
I tried to change the timeout value from 30 to 90 for pexpect in the following script... #!/usr/bin/python import telnetlib import time import pexpect def get_name(): user = raw_input(\nUsername: ) password = raw_input(Password: ) idle(user, password) def idle(user, password):

Re: odd runtime error

2010-12-01 Thread Chris Rebert
On Wed, Dec 1, 2010 at 4:49 PM, David Brown dmlb2...@gmail.com wrote: So I'm not subscribed to python-list but would like to get an answer to my question. I've made a small test program that dumps a RuntimeError and I'd like to know why. $ python test2.py doing stuff Traceback (most recent

Re: odd runtime error

2010-12-01 Thread David Brown
On Wed, Dec 1, 2010 at 4:59 PM, Chris Rebert c...@rebertia.com wrote: On Wed, Dec 1, 2010 at 4:49 PM, David Brown dmlb2...@gmail.com wrote: So I'm not subscribed to python-list but would like to get an answer to my question. I've made a small test program that dumps a RuntimeError and I'd like

Re: odd runtime error

2010-12-01 Thread James Mills
On Thu, Dec 2, 2010 at 10:59 AM, Chris Rebert c...@rebertia.com wrote: On Wed, Dec 1, 2010 at 4:49 PM, David Brown dmlb2...@gmail.com wrote: So I'm not subscribed to python-list but would like to get an answer to my question. I've made a small test program that dumps a RuntimeError and I'd

Re: odd runtime error

2010-12-01 Thread Cameron Simpson
On 01Dec2010 16:49, David Brown dmlb2...@gmail.com wrote: | So I'm not subscribed to python-list but would like to get an answer | to my question. I've made a small test program that dumps a | RuntimeError and I'd like to know why. | | $ python test2.py | doing stuff | Traceback (most recent call

Re: odd runtime error

2010-12-01 Thread David Brown
On Wed, Dec 1, 2010 at 5:19 PM, Cameron Simpson c...@zip.com.au wrote: On 01Dec2010 16:49, David Brown dmlb2...@gmail.com wrote: | So I'm not subscribed to python-list but would like to get an answer | to my question. I've made a small test program that dumps a | RuntimeError and I'd like to

Re: multiple modules from single c extension

2010-12-01 Thread Robert Kern
On 12/1/10 4:12 PM, Eric Frederich wrote: I have an extension to some C library that I created using the guide found here... http://docs.python.org/extending/extending.html I am starting to have A LOT of functions being wrapped. The library that I'm creating bindings for is organized

Re: Packages at Python.org

2010-12-01 Thread kirby urner
Good to hear from you sir. I've enjoying working with your modules and am getting some good results. I sent you a note off-list wondering how actively you might be supporting this valuable utility. Encouraging to find you here so quickly. Kirby On Wed, Dec 1, 2010 at 2:32 PM, Ethan Furman

docstring inheritance

2010-12-01 Thread HughSW
We've been trying to find an easy way to inherit docstrings when overriding methods in subclasses, e.g. so that Sphinx does a nice job. We used Shai's DocInherit code from this post:

Re: docstring inheritance

2010-12-01 Thread HughSW
G, sorry about the line wrapping horror; trying again. class InheritDoc(object): Docstring inheriting method descriptor The class itself is used as a decorator that creates a class property for the method; the first time the property is used it installs the method's doc

Re: Python's equivalent to Main calling program and subprograms

2010-12-01 Thread Bill Allen
Thanks for the explanation of main. Some tutorials mention it, some don't. I have written some not trial Python programs and have never had a real need to use that convention, but at least I understand it now. --Bill On Wed, Dec 1, 2010 at 1:13 PM, Tim Harig user...@ilthio.net wrote: On

Re: odd runtime error

2010-12-01 Thread Cameron Simpson
On 01Dec2010 17:27, David Brown dmlb2...@gmail.com wrote: | Thanks for the clarification No worries. | I like the idea of wrapping all the | primary code in the script to a main function then calling it if its | being called by main. I find that useful too. I've got a few

How can I define class methods outside of the class?

2010-12-01 Thread Jeremy
I have some methods that I need (would like) to define outside of the class. I know this can be done by defining the function and then setting it equal to some member of an instance of the class. But, because of the complexity of what I'm doing (I have to set many functions as class methods) I

Re: How can I define class methods outside of the class?

2010-12-01 Thread James Mills
On Thu, Dec 2, 2010 at 3:36 PM, Jeremy jlcon...@gmail.com wrote: I have some methods that I need (would like) to define outside of the class.  I know this can be done by defining the function and then setting it equal to some member of an instance of the class.  But, because of the complexity

Unicode thing that causes a traceback in 2.6 and 2.7 but not in 2.5, and only when writing to a pipe, not to the terminal

2010-12-01 Thread Dan Stromberg
What is this about? It's another n~ thing, but this time in 2.x. All I'm doing is printing a str containing a character 127. It works fine in 2.5, to a terminal or to a pipe. In 2.6 and 2.7, it fails when writing to a pipe but works fine writing to my terminal - an mrxvt.\ I really kind of

Re: Some syntactic sugar proposals

2010-12-01 Thread Steven D'Aprano
On Wed, 01 Dec 2010 15:18:32 -0800, Dmitry Groshev wrote: Here is a fresh example of what I meant by my first proposal. You need to build a matrix like this: 2 1 0 ... 1 2 1 ... 0 1 2 ... ... ... 1 2 1 ... 0 1 2 You could do this by one-liner: [[(2 - abs(x - y)) if it 0 else 0 for x in

DBF (VFP) to XLS (Excel) in pure Python

2010-12-01 Thread kirby.ur...@gmail.com
Playing around with arcane tools to read those pesky DBF files (with memo fields), like floating wine barrels cast off the sinking VFP ship. http://pypi.python.org/pypi/dbf http://packages.python.org/dbf/dbf-module.html Me threading on comp.lang.python: http://bit.ly/e547Za xlwt and xlrt for

Comparison with False - something I don't understand

2010-12-01 Thread Harishankar
When I run pychecker through my modules I get the message that comparisons with False is not necessary and that it might yield unexpected results. Yet in some situations I need to specifically check whether False was returned or None was returned. Why is comparison with False so bad? #

Re: How can I define class methods outside of the class?

2010-12-01 Thread Ian Kelly
On 12/1/2010 10:47 PM, James Mills wrote: On Thu, Dec 2, 2010 at 3:36 PM, Jeremyjlcon...@gmail.com wrote: I have some methods that I need (would like) to define outside of the class. I know this can be done by defining the function and then setting it equal to some member of an instance of

[issue10592] pprint module doesn't work well with OrderedDicts

2010-12-01 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- superseder: general pprint rewrite - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10592 ___ ___

[issue3243] Support iterable bodies in httplib

2010-12-01 Thread Senthil Kumaran
Senthil Kumaran orsent...@gmail.com added the comment: Give a try to this minor variation of the patch with tests added and let me know your review comments. -- Added file: http://bugs.python.org/file19890/Issue3243-4.patch ___ Python tracker

[issue10084] SSL support for asyncore

2010-12-01 Thread Dirkjan Ochtman
Changes by Dirkjan Ochtman dirk...@ochtman.nl: -- nosy: +djc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10084 ___ ___ Python-bugs-list mailing

[issue3243] Support iterable bodies in httplib

2010-12-01 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Senthil: +try: + self.sock.sendall(data) Indentation problem here. +if isinstance(data,str): +content_length = len(data) I'm not sure I understand. What does sending an unicode string mean?

[issue10594] Typo in PyList_New doc.

2010-12-01 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: You don't need to backport, we'll do it ourselves. Can someone from the doc team please review/commit? -- assignee: eli.bendersky - d...@python nosy: +pitrou stage: - patch review ___ Python tracker

[issue8805] urllib should support SSL contexts

2010-12-01 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: HTTPSHandler now allows to pass an SSLContext and the old API should be buried in the ground, closing. -- resolution: - rejected status: open - closed ___ Python tracker rep...@bugs.python.org

[issue10595] Adding a syslog.conf reader in syslog

2010-12-01 Thread Tarek Ziadé
New submission from Tarek Ziadé ziade.ta...@gmail.com: The syslog module allows to configure via openlog() the facility. There's one missing feature though, I'd love to have in a new API: a way to read the syslog configuration, and in particular to know where each facility file is located on

[issue10596] modulo operator bug

2010-12-01 Thread Сергей Хлутчин
New submission from Сергей Хлутчин serc...@gmail.com: Result of the modulo operator is wrong: (-2.22044604925e-16)%4 4.0 (-4.0)%4 -0.0 -- messages: 122991 nosy: Sergio.Ĥlutĉin priority: normal severity: normal status: open title: modulo operator bug type: behavior versions: Python

[issue10596] modulo operator bug

2010-12-01 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10596 ___ ___ Python-bugs-list

[issue10596] modulo operator bug

2010-12-01 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: What results were you expecting here? Both those results look fine to me (though it's arguable that the second should be +0.0 rather than -0.0). -- assignee: - mark.dickinson ___ Python tracker

[issue10596] modulo operator bug

2010-12-01 Thread Сергей Хлутчин
Сергей Хлутчин serc...@gmail.com added the comment: From the documetation: The modulo operator always yields a result with the same sign as its second operand (or zero); the absolute value of the result is strictly smaller than the absolute value of the second operand. --

[issue7359] mailbox cannot modify mailboxes in system mail spool

2010-12-01 Thread Ole Laursen
Ole Laursen o...@iola.dk added the comment: Just got bitten by this too. Renaming is good and all, but as far as I can tell, it will never work with the system spool. It's not just that you can't create a temporary file in the directory, you can't rename files into it either. If I create an

  1   2   >