EPD 7.0 released

2011-02-09 Thread Ilan Schnell
Hello, I am pleased to announce that EPD (Enthought Python Distribution) version 7.0 has been released. This major release updates to Python 2.7, Intel Math Kernel Library 10.3.1, numpy 1.5.1, in addition to updates to many of the other packages included. Please find the complete list of

Re: Unicode error in sax parser

2011-02-09 Thread Rickard Lindberg
On Tue, Feb 8, 2011 at 5:41 PM, Chris Rebert c...@rebertia.com wrote: Here is a bash script to reproduce my error: Including the error message and traceback is still helpful, for future reference. Thanks for pointing it out.    #!/bin/sh    cat å.timeline EOF snip    EOF    python

Re: [python-list] - what do you think ?

2011-02-09 Thread Stephen Hansen
On 2/8/11 8:00 PM, Vivek Shrivastava wrote: I think that will help people like me who just depend on gmail, and I know there are various ways to do filtering in gmail, but just addition of the tag in [ ] will help avoiding those.. I kindly second that.. .. yeah, no. Let's not screw up

Re: Unicode error in sax parser

2011-02-09 Thread Stefan Behnel
Rickard Lindberg, 09.02.2011 09:32: On Tue, Feb 8, 2011 at 5:41 PM, Chris Rebertc...@rebertia.com wrote: Here is a bash script to reproduce my error: Including the error message and traceback is still helpful, for future reference. Thanks for pointing it out. #!/bin/sh cat

Re: Unicode error in sax parser

2011-02-09 Thread Stefan Behnel
Stefan Behnel, 09.02.2011 09:58: Rickard Lindberg, 09.02.2011 09:32: On Tue, Feb 8, 2011 at 5:41 PM, Chris Rebertc...@rebertia.com wrote: Here is a bash script to reproduce my error: Including the error message and traceback is still helpful, for future reference. Thanks for pointing it

Re: Python subprocesses experience mysterious delay in receiving stdin EOF

2011-02-09 Thread Yang Zhang
On Wed, Feb 9, 2011 at 11:01 AM, MRAB pyt...@mrabarnett.plus.com wrote: On 09/02/2011 01:59, Yang Zhang wrote: I reduced a problem I was seeing in my application down into the following test case. In this code, a parent process concurrently spawns 2 (you can spawn more) subprocesses that read

Re: - what do you think ?

2011-02-09 Thread przemolicc
On Tue, Feb 08, 2011 at 01:20:48PM -0500, Terry Reedy wrote: On 2/8/2011 7:18 AM, przemol...@poczta.fm wrote: On Tue, Feb 08, 2011 at 10:16:42PM +1100, Ben Finney wrote: Either way, please don't ask for the subject lines to be munged. Any technical reason why not ? For one reason,

wsgi, ajax, and multiple requests

2011-02-09 Thread Frank Millman
Hi all I have a question about wsgi. As far as I can tell from the spec and from the reference implementation, wsgi requires that each request from the client is responded to by one or more headers, followed by the response body. It is then ready to handle the next request. 99% of the time

Your message to Devel awaits moderator approval

2011-02-09 Thread devel-bounces
Your mail to 'Devel' with the subject TEST Is being held until the list moderator can review it for approval. The reason it is being held: Post by non-member to a members-only list Either the message will get posted to the list, or you will receive notification of the moderator's

Re: Unicode error in sax parser

2011-02-09 Thread Rickard Lindberg
Did you read my reply? Sorry, it was me who failed to read your question properly. Unicode file names aren't really working well, especially not in Py2.x. Python 3.2 provides many improvements here. I assume your file system encoding is UTF-8? What does sys.getfilesystemencoding() give you?

Re: Unicode error in sax parser

2011-02-09 Thread Stefan Behnel
Rickard Lindberg, 09.02.2011 14:01: Did you read my reply? Sorry, it was me who failed to read your question properly. Unicode file names aren't really working well, especially not in Py2.x. Python 3.2 provides many improvements here. I assume your file system encoding is UTF-8? What does

Re: wsgi, ajax, and multiple requests

2011-02-09 Thread Adam Tauno Williams
On Wed, 2011-02-09 at 14:31 +0200, Frank Millman wrote: I am dabbling with writing an ajax-style app. On occasion, I want to send more than one message from the client to the server. It is important that the server processes the messages in the same order that they are generated. I have

Re: Easy function, please help.

2011-02-09 Thread RJB
On Feb 8, 11:08 pm, Paul Rudin paul.nos...@rudin.co.uk wrote: It works because 0 tests false and because integer division yields integers... eventually you'll get something like 1/10 giving 0. It's not necessarily a good thing to rely on. For example if you try it after from __future__

Re: Easy function, please help.

2011-02-09 Thread Nicholas Devenish
On 09/02/2011 14:27, RJB wrote: What operator should I use if I want integer division? Ada and Pascal used div if I recall rightly. The operator for integer division is // -- http://mail.python.org/mailman/listinfo/python-list

Re: Easy function, please help.

2011-02-09 Thread Terry Reedy
On 2/9/2011 9:27 AM, RJB wrote: On Feb 8, 11:08 pm, Paul Rudinpaul.nos...@rudin.co.uk wrote: It works because 0 tests false and because integer division yields integers... eventually you'll get something like 1/10 giving 0. It's not necessarily a good thing to rely on. For example if you try

Re: Easy function, please help.

2011-02-09 Thread rantingrick
On Feb 9, 1:08 am, Paul Rudin paul.nos...@rudin.co.uk wrote: Nanderson mandersonrandersonander...@gmail.com writes: loop would be infinite. I get what is happening in the function, and I understand why this would work, but for some reason it's confusing me as to how it is exiting the loop

Re: Unicode error in sax parser

2011-02-09 Thread Rickard Lindberg
On Tue, Feb 8, 2011 at 5:41 PM, Chris Rebert c...@rebertia.com wrote: On Tue, Feb 8, 2011 at 7:57 AM, Rickard Lindberg ricl...@gmail.com wrote: Hi, Here is a bash script to reproduce my error: Including the error message and traceback is still helpful, for future reference.    #!/bin/sh

PyCon 2011 news - going strong, sign up today!

2011-02-09 Thread Brian Curtin
Hey python-list readers! PyCon 2011 looks like it may very well break every single record in the past - making it one of the biggest and best PyCons of all time. We've gone all out this year - including Extreme Talks, a Startup Row, amazing talks, tutorials, Poster sessions. Extreme talks:

Re: How to Write grep in Emacs Lisp (tutorial)

2011-02-09 Thread Harald Hanche-Olsen
[Icarus Sparry i.sparry...@gmail.com] The 'modern' way to do this is find . -maxdepth 2 -name '*.html' -exec grep whatever {} + Actually, I think it should be find . -maxdepth 2 -name '*.html' -exec grep whatever /dev/null {} + because grep behaves differently when given only one filename as

Re: How to Write grep in Emacs Lisp (tutorial)

2011-02-09 Thread Harald Hanche-Olsen
[Icarus Sparry i.sparry...@gmail.com] The 'modern' way to do this is find . -maxdepth 2 -name '*.html' -exec grep whatever {} + Actually, I think it should be find . -maxdepth 2 -name '*.html' -exec grep whatever /dev/null {} + \; because grep behaves differently when given only one filename

Re: Remove whitespaces and line breaks in a XML file

2011-02-09 Thread Jean-Michel Pichavant
Josh English wrote: I found the code posted at http://infix.se/2007/02/06/gentlemen-indent-your-xml quite helpful in turning my xml into human-readable structures. It works best for XML-Data. Josh It's done in one line with

Re: Python subprocesses experience mysterious delay in receiving stdin EOF

2011-02-09 Thread Jean-Michel Pichavant
Yang Zhang wrote: On Wed, Feb 9, 2011 at 11:01 AM, MRAB pyt...@mrabarnett.plus.com wrote: On 09/02/2011 01:59, Yang Zhang wrote: I reduced a problem I was seeing in my application down into the following test case. In this code, a parent process concurrently spawns 2 (you can spawn

Re: frequency of values in a field

2011-02-09 Thread noydb
The Decimal module is pretty slow but is conceptually probably the right way to do this.  With just 50k records it shouldn't be too bad.  With more records you might look for a faster way.     from decimal import Decimal as D     from collections import defaultdict     records =

Re: frequency of values in a field

2011-02-09 Thread Josh English
On Wednesday, February 9, 2011 9:52:27 AM UTC-8, noydb wrote: So it seems the idea is to add all the records in the particular field of interest into a list (record). How does one do this in pure Python? Normally in my work with gis/arcgis sw, I would do a search cursor on the DBF file

Uploading files to an an FTP site through a proxy server which requires authentication

2011-02-09 Thread tkp...@hotmail.com
I would like to upload files to a ftp site, but can't seem to get through our proxy server, which requires authentication. How can one do this in Python (I use 2.7, but am more than happy to use 3.2 rc2) Thanks in advance Thomas Philips -- http://mail.python.org/mailman/listinfo/python-list

Re: frequency of values in a field

2011-02-09 Thread noydb
On Feb 9, 1:21 pm, Josh English joshua.r.engl...@gmail.com wrote: On Wednesday, February 9, 2011 9:52:27 AM UTC-8, noydb wrote: So it seems the idea is to add all the records in the particular field of interest into a list (record).  How does one do this in pure Python? Normally in my

inheritance, multiple inheritance and the weaklist and instance dictionaries

2011-02-09 Thread Rouslan Korneychuk
I'm working on a program that automatically generates C++ code for a Python extension and I noticed a few limitations when using the weaklist and instance dictionaries (tp_weaklistoffset and tp_dictoffset). This is pertaining to the C API. I noticed that when using multiple inheritance, I

Re: Land Of Lisp is out

2011-02-09 Thread William James
Pascal J. Bourguignon wrote: sthueb...@googlemail.com (Stefan Hübner) writes: Would it be right to say that the only Lisp still in common use is the Elisp built into Emacs? Clojure (http://clojure.org) is a Lisp on the JVM. It's gaining more and more traction. There are actually

Programmatic Parsing of ps

2011-02-09 Thread octopusgrabbus
I have Python 2.6.6. I would like to get this output ps -ef | grep 'fglgo csm' into a list. What is the best way to do that? I've been reading the documentation, and am lost. Thank you. cmn -- http://mail.python.org/mailman/listinfo/python-list

Re: wsgi, ajax, and multiple requests

2011-02-09 Thread Paul Rubin
Frank Millman fr...@chagford.com writes: So the question is, how can I achieve this with wsgi? If I detect that I have received a request out of sequence, I can queue the request, and send an empty response. I don't see how that can help, on the server side. Even if you send the responses in

Re: frequency of values in a field

2011-02-09 Thread Paul Rubin
noydb jenn.du...@gmail.com writes: counts = {} for thing in long_list:   key = make_key(thing)   if key in counts:     counts[key] += 1   else:     counts[key] = 1 counts = {} for thing i long_list: key = make_key(thing) counts[key] = 1 + counts.get(key, 0) How do you add all the

Re: Programmatic Parsing of ps

2011-02-09 Thread Emile van Sebille
On 2/9/2011 10:58 AM octopusgrabbus said... I have Python 2.6.6. I would like to get this output ps -ef | grep 'fglgo csm' into a list. What is the best way to do that? I've been reading the documentation, and am lost. Thank you. cmn commands.getoutput Emile --

RE: frequency of values in a field

2011-02-09 Thread Andreas Tawn
How do you add all the records in the particular field of interest into long_list? From earlier in the thread you did... import arcgisscripting # Create the geoprocessor object gp = arcgisscripting.create() records_list = [] cur = gp.SearchCursor(dbfTable) row = cur.Next() while row: value

Re: Socket connection between python and C

2011-02-09 Thread Irmen de Jong
On 09-02-11 01:54, Williamson, Ross X. (Guest) wrote: Dear All, I'm trying to implement a server/client system where the server is written in python and the client has to be written in c/c++. I can happily send simple text through the socket. Ideally I would like make say a struct (using

Re: inheritance, multiple inheritance and the weaklist and instance dictionaries

2011-02-09 Thread Carl Banks
On Feb 9, 10:54 am, Rouslan Korneychuk rousl...@msn.com wrote: I'm working on a program that automatically generates C++ code for a Python extension and I noticed a few limitations when using the weaklist and instance dictionaries (tp_weaklistoffset and tp_dictoffset). This is pertaining to

Re: [python-list] - what do you think ?

2011-02-09 Thread Stephen Hansen
On 2/9/11 12:36 AM, Stephen Hansen wrote: .. yeah, no. Okay, I actually have to apologize for the tone of this message. It was late and I was a jerk. I could have just been helpful without including the jerk, but something about it set me off. So the helpful and the jerk got mixed in together.

Re: Land Of Lisp is out

2011-02-09 Thread Peter Keller
In comp.lang.lisp William James w_a_x_...@yahoo.com wrote: Pascal J. Bourguignon wrote: sthueb...@googlemail.com (Stefan H?bner) writes: Would it be right to say that the only Lisp still in common use is the Elisp built into Emacs? Clojure (http://clojure.org) is a Lisp on the JVM.

Re: frequency of values in a field

2011-02-09 Thread Josh English
On Wednesday, February 9, 2011 10:34:12 AM UTC-8, noydb wrote: How do you add all the records in the particular field of interest into long_list? Sorry to be unclear. In both cases I was tossing out pseudo-code, as I am not familiar with the arggisscripting module. long_list is a list with

Re: frequency of values in a field

2011-02-09 Thread Ethan Furman
noydb wrote: Paul Rubin wrote: The Decimal module is pretty slow but is conceptually probably the right way to do this. With just 50k records it shouldn't be too bad. With more records you might look for a faster way. from decimal import Decimal as D from collections import

Re: How to Write grep in Emacs Lisp (tutorial)

2011-02-09 Thread Tassilo Horn
Xah Lee xah...@gmail.com writes: You can rely on shell globbing, so that grep gets a list of all files in all subdirectories.  For example, I can grep all header files of the linux kernel using   % grep FOO /usr/src/linux/**/*.h say, i want to search in the dir ~/web/xahlee_org/ but no

Re: frequency of values in a field

2011-02-09 Thread noydb
On Feb 9, 3:08 pm, Josh English joshua.r.engl...@gmail.com wrote: On Wednesday, February 9, 2011 10:34:12 AM UTC-8, noydb wrote: How do you add all the records in the particular field of interest into long_list? Sorry to be unclear. In both cases I was tossing out pseudo-code, as I am not

Re: Socket connection between python and C

2011-02-09 Thread Stefan Behnel
Williamson, Ross X. wrote: I'm trying to implement a server/client system where the server is written in python and the client has to be written in c/c++. Is this a strict requirement? Could you give us a hint why the client needs to be plain C/C++? Stefan --

Re: frequency of values in a field

2011-02-09 Thread noydb
On Feb 9, 3:28 pm, Ethan Furman et...@stoneleaf.us wrote: noydb wrote:   Paul Rubin wrote: The Decimal module is pretty slow but is conceptually probably the right way to do this.  With just 50k records it shouldn't be too bad.  With more records you might look for a faster way.  

Re: inheritance, multiple inheritance and the weaklist and instance dictionaries

2011-02-09 Thread Rouslan Korneychuk
On 02/09/2011 02:42 PM, Carl Banks wrote: On Feb 9, 10:54 am, Rouslan Korneychukrousl...@msn.com wrote: I'm working on a program that automatically generates C++ code for a Python extension and I noticed a few limitations when using the weaklist and instance dictionaries (tp_weaklistoffset and

Re: Programmatic Parsing of ps

2011-02-09 Thread Dan Stromberg
On Wed, Feb 9, 2011 at 11:15 AM, Emile van Sebille em...@fenx.com wrote: On 2/9/2011 10:58 AM octopusgrabbus said... I have Python 2.6.6. I would like to get this output ps -ef | grep 'fglgo csm' into a list. What is the best way to do that? I've been reading the documentation, and am

Re: Easy function, please help.

2011-02-09 Thread Jason Swails
You've gotten several good explanations, mainly saying that 0 - False and not 0 - True, which is why the while loop exits. You've also gotten advice about how to make your method more robust (i.e. force integer division). However, as surprising as this may be I'm actually with RR on this one

OO Python

2011-02-09 Thread Paul Symonds
Are there any good resources to learn OO Python from? -- http://mail.python.org/mailman/listinfo/python-list

Re: inheritance, multiple inheritance and the weaklist and instance dictionaries

2011-02-09 Thread Carl Banks
On Feb 9, 1:14 pm, Rouslan Korneychuk rousl...@msn.com wrote: On 02/09/2011 02:42 PM, Carl Banks wrote: This is the only case I can think of where the layout conflict would be caused by a type setting tp_dictoffset. No, actually I have code that is roughly equivalent to the following

Re: inheritance, multiple inheritance and the weaklist and instance dictionaries

2011-02-09 Thread Carl Banks
On Feb 9, 1:14 pm, Rouslan Korneychuk rousl...@msn.com wrote: Each Python class is a wrapper for a C++ class. Also, if you want my opinion (you probably don't after you've already gone to so much trouble, but here it is anyway): It's not worth it to mimic the C++ type hierarchy in Python. Just

Re: Easy function, please help.

2011-02-09 Thread MRAB
On 09/02/2011 21:42, Jason Swails wrote: You've gotten several good explanations, mainly saying that 0 - False and not 0 - True, which is why the while loop exits. You've also gotten advice about how to make your method more robust (i.e. force integer division). However, as surprising as this

Re: [python-list] - what do you think ?

2011-02-09 Thread Kushal Kumaran
- Original message - On 2011-02-08, przemol...@poczta.fm przemol...@poczta.fm wrote: I have just subscribed to this python-list@ and this is my N list. Usually many mailing lists use square brackets to identify its name when you have e-mails from different forums. Would you

Re: OO Python

2011-02-09 Thread Corey Richardson
On 02/09/2011 04:50 PM, Paul Symonds wrote: Are there any good resources to learn OO Python from? To my knowledge, all Python is OO. What specifically about OOP do you want to know? http://www.alan-g.me.uk/tutor/tutclass.htm I've always liked Alan's site. Come over to the Tutor list if you

Re: inheritance, multiple inheritance and the weaklist and instance dictionaries

2011-02-09 Thread Rouslan Korneychuk
On 02/09/2011 04:58 PM, Carl Banks wrote: On Feb 9, 1:14 pm, Rouslan Korneychukrousl...@msn.com wrote: On 02/09/2011 02:42 PM, Carl Banks wrote: This is the only case I can think of where the layout conflict would be caused by a type setting tp_dictoffset. No, actually I have code that is

Re: inheritance, multiple inheritance and the weaklist and instance dictionaries

2011-02-09 Thread Rouslan Korneychuk
On 02/09/2011 05:02 PM, Carl Banks wrote: On Feb 9, 1:14 pm, Rouslan Korneychukrousl...@msn.com wrote: Each Python class is a wrapper for a C++ class. Also, if you want my opinion (you probably don't after you've already gone to so much trouble, but here it is anyway): No, your opinion is

Re: Easy function, please help.

2011-02-09 Thread Rikishi42
On 2011-02-09, Michael Hrivnak mhriv...@hrivnak.org wrote: Your function only works if n is an integer. Example: num_digits(234) 3 num_digits(23.4) 325 When doing integer division, python will throw away the remainder and return an int. Using your example of n==44, 44/10 == 4 and 4/10

Re: Easy function, please help.

2011-02-09 Thread Rikishi42
On 2011-02-09, rantingrick rantingr...@gmail.com wrote: On Feb 9, 1:08�am, Paul Rudin paul.nos...@rudin.co.uk wrote: Nanderson mandersonrandersonander...@gmail.com writes: loop would be infinite. I get what is happening in the function, and I understand why this would work, but for some

Re: Easy function, please help.

2011-02-09 Thread rantingrick
On Feb 9, 5:00 pm, Rikishi42 skunkwo...@rikishi42.net wrote: [...] Using 0 as false and any other value as true is hardly unique to python. Lots of languages have been doing this long before Python even existed. Well, the only way to reply is to paraphrase an anecdotes my mother would tell me

Re: Easy function, please help.

2011-02-09 Thread Steven D'Aprano
On Thu, 10 Feb 2011 00:00:48 +0100, Rikishi42 wrote: I would have defined the flaw to be use of '/' for the integer division. Well, it was a long time ago, when it seemed like a good idea. Now, Python has // for integer division. -- Steven --

Re: OO Python

2011-02-09 Thread Ben Finney
Paul Symonds paul.j.symo...@gmail.com writes: Are there any good resources to learn OO Python from? The first resource to use is the Python tutorial URL:http://docs.python.org/tutorial/. Work through the whole thing: read the text and run the examples yourself, then experiment until you

Re: Easy function, please help.

2011-02-09 Thread Westley Martínez
On Wed, 2011-02-09 at 06:51 -0800, rantingrick wrote: On Feb 9, 1:08 am, Paul Rudin paul.nos...@rudin.co.uk wrote: Nanderson mandersonrandersonander...@gmail.com writes: loop would be infinite. I get what is happening in the function, and I understand why this would work, but for some

Re: Easy function, please help.

2011-02-09 Thread Littlefield, Tyler
Uh oh, I think we found RR's evil twin: another python to the modern day visionary. Example 1 is not explicit enough. Too much guessing is required by the reader! if list is empty, bla. if not, bla. it's not all that hard, and there's no guessing that needs to take place, honest. --

Re: Easy function, please help.

2011-02-09 Thread alex23
rantingrick rantingr...@gmail.com wrote: Well, the only way to reply is to paraphrase an anecdotes my mother would tell me often as a young lad... Mother: Just because other language developers choose to jump off the cliffs of implicit-ey should we jump also? You think of yourself as a

Re: EPD 7.0 released

2011-02-09 Thread Eric Stechmann
Hi, son. Don't know if this would be of any interest to you. Well, I suppose it does provide some interesting. I hope your physical get-together will help out. Love you, David. Dad On Feb 9, 2011, at 8:13 AM, Ilan Schnell wrote: Hello, I am pleased to announce that EPD (Enthought

Re: Easy function, please help.

2011-02-09 Thread Ethan Furman
Jason Swails wrote: However, as surprising as this may be I'm actually with RR on this one (for a little) -- for code readability's sake, you should make your conditional more readable (i.e. don't depend on the fact that the iterations will take your test value down to 0 which conveniently in

Re: inheritance, multiple inheritance and the weaklist and instance dictionaries

2011-02-09 Thread Carl Banks
On Feb 9, 3:11 pm, Rouslan Korneychuk rousl...@msn.com wrote: On 02/09/2011 04:58 PM, Carl Banks wrote: On Feb 9, 1:14 pm, Rouslan Korneychukrousl...@msn.com  wrote: On 02/09/2011 02:42 PM, Carl Banks wrote: This is the only case I can think of where the layout conflict would be caused by

Re: Python subprocesses experience mysterious delay in receiving stdin EOF

2011-02-09 Thread Yang Zhang
On Thu, Feb 10, 2011 at 12:28 AM, Jean-Michel Pichavant jeanmic...@sequans.com wrote: Yang Zhang wrote: On Wed, Feb 9, 2011 at 11:01 AM, MRAB pyt...@mrabarnett.plus.com wrote: On 09/02/2011 01:59, Yang Zhang wrote: I reduced a problem I was seeing in my application down into the

Re: How to Write grep in Emacs Lisp (tutorial)

2011-02-09 Thread Rob Warnock
Harald Hanche-Olsen han...@math.ntnu.no wrote: +--- | [Icarus Sparry i.sparry...@gmail.com] | The 'modern' way to do this is | find . -maxdepth 2 -name '*.html' -exec grep whatever {} + | | Actually, I think it should be | find . -maxdepth 2 -name '*.html' -exec grep whatever

Re: How to Write grep in Emacs Lisp (tutorial)

2011-02-09 Thread Rob Warnock
Harald Hanche-Olsen han...@math.ntnu.no wrote: +--- | [Icarus Sparry i.sparry...@gmail.com] | The 'modern' way to do this is | find . -maxdepth 2 -name '*.html' -exec grep whatever {} + | | Actually, I think it should be | find . -maxdepth 2 -name '*.html' -exec grep whatever

Re: inheritance, multiple inheritance and the weaklist and instance dictionaries

2011-02-09 Thread Rouslan Korneychuk
On 02/09/2011 08:40 PM, Carl Banks wrote: I explained why in my last post; there's a bunch of reasons. Generally you can't assume someone's going to go through the type structure to find the object's dict, nor can you expect inherited methods to always use the derived class's type structure

Re: How to Write grep in Emacs Lisp (tutorial)

2011-02-09 Thread Thomas L. Shinnick
At 09:39 PM 2/9/2011, Rob Warnock wrote: Harald Hanche-Olsen han...@math.ntnu.no wrote: [snip] Years years ago, right after I learned about xargs, I got burned several times on find | xargs grep pat when the file list was long enough that xargs fired up more than one grep... and the last

Re: Easy function, please help.

2011-02-09 Thread Jason Swails
On Wed, Feb 9, 2011 at 5:34 PM, MRAB pyt...@mrabarnett.plus.com wrote: On 09/02/2011 21:42, Jason Swails wrote: You've gotten several good explanations, mainly saying that 0 - False and not 0 - True, which is why the while loop exits. You've also gotten advice about how to make your method

Re: Easy function, please help.

2011-02-09 Thread Jason Swails
On Wed, Feb 9, 2011 at 8:16 PM, Ethan Furman et...@stoneleaf.us wrote: Jason Swails wrote: However, as surprising as this may be I'm actually with RR on this one (for a little) -- for code readability's sake, you should make your conditional more readable (i.e. don't depend on the fact that

Markdown to reStructuredText

2011-02-09 Thread Michele Simionato
Do you know if there is any converter from the Markdown syntax to the rst syntax? Googling for markdown2rst did not help. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Easy function, please help.

2011-02-09 Thread drygal
On 9 Lut, 06:29, Michael Hrivnak mhriv...@hrivnak.org wrote: Your function only works if n is an integer.  Example: num_digits(234) 3 num_digits(23.4) 325 When doing integer division, python will throw away the remainder and return an int.  Using your example of n==44, 44/10 == 4 and

Problem with giant font sizes in tkinter

2011-02-09 Thread Steven D'Aprano
I have a tkinter application under Python 2.6 which is shows text in a giant font, about twenty(?) times larger than expected. The fonts are set using: titlefont = '-Adobe-Helvetica-Bold-R-Normal-*-180-*' buttonfont = '-Adobe-Helvetica-Bold-R-Normal-*-140-*' labelfont =

Re: Trying to decide between PHP and Python

2011-02-09 Thread Benjamin J. Racine
Cython/Sage is no small undertaking, but I have no idea how to measure relative success between that and hiphop. Ben On Jan 6, 2011, at 11:11 AM, John Nagle wrote: On 1/4/2011 12:20 PM, Google Poster wrote: About once a year, I have to learn yet another programming language. Given all the

Re: How to Write grep in Emacs Lisp (tutorial)

2011-02-09 Thread Petter Gustad
r...@rpw3.org (Rob Warnock) writes: invocation was given only one arg!! IT FOUND THE PATTERN, BUT DIDN'T TELL ME WHAT !@^%!$@#@! FILE IT WAS IN!! :-{ Sounds frustrating, but grep -H will always print the filename, even when given a single filename on the command line. //Petter -- .sig

Re: Easy function, please help.

2011-02-09 Thread Steven D'Aprano
On Wed, 09 Feb 2011 22:53:27 -0800, drygal wrote: I guess it needs: def num_digits(n): return len(str(n)) -1 I don't think so. num_digits(9) 0 -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: OO Python

2011-02-09 Thread Terry Reedy
On 2/9/2011 4:50 PM, Paul Symonds wrote: Are there any good resources to learn OO Python from? I learned some from classes in stdlib modules. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Easy function, please help.

2011-02-09 Thread Terry Reedy
On 2/9/2011 6:00 PM, Rikishi42 wrote: numeric types. I would have defined the flaw to be use of '/' for the integer division. Guido agreed, and hence changed it (after much contentious discussion!). -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Markdown to reStructuredText

2011-02-09 Thread Daniel Stender
http://johnmacfarlane.net/pandoc/ Greetings, DS On 10.02.2011 06:38, Michele Simionato wrote: Do you know if there is any converter from the Markdown syntax to the rst syntax? Googling for markdown2rst did not help. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: wsgi, ajax, and multiple requests

2011-02-09 Thread Frank Millman
Frank Millman wrote: Hi all I have a question about wsgi. As far as I can tell from the spec and from the reference implementation, wsgi requires that each request from the client is responded to by one or more headers, followed by the response body. It is then ready to handle the next

[issue11158] Parent process did not quit after sys.exit()

2011-02-09 Thread Pham Cong Dinh
New submission from Pham Cong Dinh pcd...@gmail.com: Hi, I was implementing a multiple process compatible logging which child processes are expected to send all messages to the parent process via a queue and then the parent process serializes and flushes them into a log file. The idea is

[issue11158] Python VM deadlock

2011-02-09 Thread Pham Cong Dinh
Changes by Pham Cong Dinh pcd...@gmail.com: -- title: Parent process did not quit after sys.exit() - Python VM deadlock ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11158 ___

[issue11153] urllib2 basic auth parser handle unquoted realm in WWW-Authenticate header

2011-02-09 Thread Senthil Kumaran
Changes by Senthil Kumaran orsent...@gmail.com: -- assignee: - orsenthil nosy: +orsenthil ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11153 ___

[issue11145] '%o' % user-defined instance

2011-02-09 Thread Armin Rigo
Armin Rigo ar...@users.sourceforge.net added the comment: Eric: that's wrong, it is a magic method. See for example __oct__ in Objects/typeobject.c. I'm not sure I understand why you would point this out, though. A SystemError: bad argument to internal function or an Assertion failed are

[issue11145] '%o' % user-defined instance

2011-02-09 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +benjamin.peterson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11145 ___ ___ Python-bugs-list

[issue11157] Use socket.accept4 syscall under linux

2011-02-09 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: This is a duplicate of issue10115. -- nosy: +pitrou resolution: - duplicate status: open - closed superseder: - Support accept4() for atomic setting of flags at socket creation ___ Python tracker

[issue10115] Support accept4() for atomic setting of flags at socket creation

2011-02-09 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Duplicated in issue11157. -- nosy: +mmarkk ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10115 ___

[issue11158] Python VM deadlock

2011-02-09 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +vinay.sajip ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11158 ___ ___ Python-bugs-list

[issue4681] mmap offset should be off_t instead of ssize_t, and size calculation needs corrected

2011-02-09 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Thanks for doing this. Looking at the patch: Modules/_io/_iomodule.h has macros for dealing with off_t (it also defines Py_off_t for Windows), perhaps you want to use them. Also, support.unlink() takes care of ignoring ENOENT for you.

[issue11145] '%o' % user-defined instance

2011-02-09 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: It's a magic method in 2.7 but not 3.x. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11145 ___

[issue11159] Sax parser crashes if given unicode file name

2011-02-09 Thread Rickard Lindberg
New submission from Rickard Lindberg ricl...@gmail.com: The error is the following: Traceback (most recent call last): File stdin, line 4, in module File /usr/lib64/python2.7/site-packages/_xmlplus/sax/__init__.py, line 31, in parse parser.parse(filename_or_stream)

[issue11156] email.encoders.encode_base64 create a single long line

2011-02-09 Thread Yves Dorfsman
Yves Dorfsman y...@zioup.com added the comment: In case this does not get fixed for a long time, here is a work around (re-implement the encoder yourself): . . . def myencoder(msg): from base64 import encodebytes as _bencode orig = msg.get_payload() encdata = str(_bencode(orig),

[issue941346] AIX shared library fix

2011-02-09 Thread Michael Haubenwallner
Michael Haubenwallner michael.haubenwall...@salomon.at added the comment: Sébastien, why did you need to add '-L$(srcdir)' to BLDSHARED in these patches? As LDLIBRARY points to the immediate file 'libpython$(VERSION).so' instead of '-lpython$(VERSION)', I don't see the need for '-L$(srcdir)'

[issue4681] mmap offset should be off_t instead of ssize_t, and size calculation needs corrected

2011-02-09 Thread Ross Lagerwall
Ross Lagerwall rosslagerw...@gmail.com added the comment: OK, this new patch applies cleanly, uses support.unlink and hexadecimal constants. I left the off_t handling as is (it seems to work on *nix testing). Perhaps someone can handle the Windows side? -- Added file:

[issue10694] zipfile.py end of central directory detection not robust

2011-02-09 Thread Xuanji Li
Xuanji Li xua...@gmail.com added the comment: I've attached a patch copying rep's patch from issue 10298, as i think it is cleaner (but it seems to do the same thing as kevin's patch) together with 2 test cases. David Murray: I'm not really sure what you mean by test comments with trailing

[issue11160] ZipFile.comment expects bytes

2011-02-09 Thread Xuanji Li
New submission from Xuanji Li xua...@gmail.com: The documentation for zipfile describes ZipFile.comment as The comment text associated with the ZIP file. From reading this I expect that setting it to a string is ok; however ZipFile.comment must actually be set to bytes (or a bytes-like

[issue10694] zipfile.py end of central directory detection not robust

2011-02-09 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Xuanji: yes, your test_ignores_stuff_appended_past_comments is exactly what I was asking for. I've put this patch on my review list, but I may not get to it until after 3.2 final. -- ___

[issue11156] email.encoders.encode_base64 create a single long line

2011-02-09 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: This appears to be a duplicate of issue 9298. Yves, if you disagree let me know what's different. -- nosy: +r.david.murray resolution: - duplicate stage: - committed/rejected status: open - closed type: - behavior versions:

  1   2   >