python stdnet 0.5 released

2011-02-24 Thread Luca Sbardella
We're happy to announce the release of python-stdnet 0.5.0. Compatible with python 2.6, 2.7 and the python 3 series. What is it? = stdnet is an object relational mapper for remote data structures. It is designed to work with redis (http://redis.io/) data-store server, but

Re: lxml

2011-02-24 Thread Stefan Behnel
MRAB, 24.02.2011 01:25: On 24/02/2011 00:10, Colin J. Williams wrote: Could someone please let me know whether lxml is available for Windows XP?. If so, is it available for Python 2.7? The latest stable release is here: http://pypi.python.org/pypi/lxml/2.2.8 Not quite the latest stable

Is this a safe use of eval?

2011-02-24 Thread Frank Millman
Hi all I know that the use of 'eval' is discouraged because of the dangers of executing untrusted code. Here is a variation that seems safe to me, but I could be missing something. I have a class, and the class has one or more methods which accept various arguments and return a result. I

Re: Is this a safe use of eval?

2011-02-24 Thread Paul Rubin
Frank Millman fr...@chagford.com writes: I then receive my_string = 'calc_area(100, 200)'. result = eval('my_inst.{0}'.format(my_string)) This will only work if the string contains a valid method name with valid arguments. Can anyone see anything wrong with this? Um, yes. What are valid

Re: Python for embedded systems?

2011-02-24 Thread Joachim Strömbergson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Aloha! On 2011:02:24 08:04 , Rafe Kettler wrote: It's not a matter of language maturity, Python is very mature, it's a matter of design. Python is a high-level, garbage-collected, interpreted language, and that's not the ideal type of language for

Re: Is this a safe use of eval?

2011-02-24 Thread Peter Otten
Frank Millman wrote: Hi all I know that the use of 'eval' is discouraged because of the dangers of executing untrusted code. Here is a variation that seems safe to me, but I could be missing something. I have a class, and the class has one or more methods which accept various

Re: Is this a safe use of eval?

2011-02-24 Thread Frank Millman
Thanks, Paul and Peter. It seemed like a good idea at the time. Thank you for straightening me out. Frank -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this a safe use of eval?

2011-02-24 Thread Ryan Kelly
On Thu, 2011-02-24 at 10:48 +0200, Frank Millman wrote: Hi all I know that the use of 'eval' is discouraged because of the dangers of executing untrusted code. Here is a variation that seems safe to me, but I could be missing something. I have a class, and the class has one or more

Re: Is this a safe use of eval?

2011-02-24 Thread Ryan Kelly
On Thu, 2011-02-24 at 20:13 +1100, Ryan Kelly wrote: On Thu, 2011-02-24 at 10:48 +0200, Frank Millman wrote: Hi all I know that the use of 'eval' is discouraged because of the dangers of executing untrusted code. Here is a variation that seems safe to me, but I could be missing

Re: Struggling to convert a mysql datetime object to a python string of a different format

2011-02-24 Thread rahul mishra
try this test = time.time(2011, 2, 1, 2, 4, 10) # this is your datetime object from mysql print time.mktime(test.timetuple()) hope this would help you On Wednesday, August 04, 2010 7:40 PM ? wrote: Okey, i have many hours now struggling to convert a mysql datetime field that i

Re: Struggling to convert a mysql datetime object to a python string of a different format

2011-02-24 Thread Corey Richardson
On 02/24/2011 04:34 AM, rahul mishra wrote: try this test = time.time(2011, 2, 1, 2, 4, 10) # this is your datetime object from mysql print time.mktime(test.timetuple()) hope this would help you You do realize that email was sent over four months ago, correct? See: On Wednesday,

Re: Running Scripts vs Interactive mode

2011-02-24 Thread scattered
On Feb 23, 5:22 pm, grobs456 gregory.alexander.robe...@gmail.com wrote: Hi, I am trying to work through the tutorial at:http://docs.python.org/tutorial/ The issue I am facing is with regards to the discussion about Invoking the Interpreter and Executable Python Scripts. It was rather hazy

Re: ctypes inheritance issue

2011-02-24 Thread Carl Banks
On Feb 23, 9:38 am, Steve steve.f.thomp...@gmail.com wrote: After looking at some metaclass examples it appears this information is readily available. A metaclass gets a dictionary containing information about the parent class (or should, at least). What examples did you look at?  It seems

Unload a DLL

2011-02-24 Thread Sathish S
Hi Ppl, I'm loading a dll using the *cdll.LoadLibrary *function. How can I release the dll after I'm done with it. Are there any functions to do this. Thanks, Sathish -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this a safe use of eval?

2011-02-24 Thread Christian Heimes
Am 24.02.2011 10:01, schrieb Peter Otten: How do you prevent that a malicious source sends you my_string = 'calc_area(__import__(os).system(rm important_file) or 100, 200)' instead? By using something like http://code.activestate.com/recipes/496746-restricted-safe-eval/ . With a

Re: Python fails on math

2011-02-24 Thread Steven D'Aprano
On Wed, 23 Feb 2011 13:26:05 -0800, John Nagle wrote: The IEEE 754 compliant FPU on most machines today, though, has an 80-bit internal representation. If you do a sequence of operations that retain all the intermediate results in the FPU registers, you get 16 more bits of precision than if

Re: 2to3 chokes on bad character

2011-02-24 Thread John Machin
On Feb 23, 7:47 pm, Frank Millman fr...@chagford.com wrote: Hi all I don't know if this counts as a bug in 2to3.py, but when I ran it on my program directory it crashed, with a traceback but without any indication of which file caused the problem. [traceback snipped] UnicodeDecodeError:

Why this difference?

2011-02-24 Thread n00m
file my.txt: === 0 beb 1 qwe 2 asd 3 hyu 4 zed 5 asd 6 oth = py script: === import sys sys.stdin = open('88.txt', 'r') t = sys.stdin.readlines() t = map(lambda rec: rec.split(), t) print t print t[2][1] ==

Re: pattern matching

2011-02-24 Thread John S
On Feb 23, 9:11 pm, monkeys paw mon...@joemoney.net wrote: if I have a string such as 'td01/12/2011/td' and i want to reformat it as '20110112', how do i pull out the components of the string and reformat them into a DDMM format? I have: import re test = re.compile('\d\d\/') f =

Re: Why this difference?

2011-02-24 Thread n00m
The 1st False is not surprising for me. It's the 2nd True is a bit hmmm... ok, it doesn't matter == Have a nice day! -- http://mail.python.org/mailman/listinfo/python-list

Re: lxml

2011-02-24 Thread Colin J. Williams
On 24-Feb-11 03:20 AM, Stefan Behnel wrote: MRAB, 24.02.2011 01:25: On 24/02/2011 00:10, Colin J. Williams wrote: Could someone please let me know whether lxml is available for Windows XP?. If so, is it available for Python 2.7? The latest stable release is here:

Re: Python fails on math

2011-02-24 Thread Ethan Furman
Steven D'Aprano wrote: On Wed, 23 Feb 2011 13:26:05 -0800, John Nagle wrote: The IEEE 754 compliant FPU on most machines today, though, has an 80-bit internal representation. If you do a sequence of operations that retain all the intermediate results in the FPU registers, you get 16 more bits

Re: Why this difference?

2011-02-24 Thread Paul Anton Letnes
Den 24.02.11 13.41, skrev n00m: The 1st False is not surprising for me. It's the 2nd True is a bit hmmm... ok, it doesn't matter == Have a nice day! I am no expert, but I think python re-uses some integer and string objects. For instance, if you create the object int(2) it

Re: 2to3 chokes on bad character

2011-02-24 Thread Peter Otten
John Machin wrote: On Feb 23, 7:47 pm, Frank Millman fr...@chagford.com wrote: Hi all I don't know if this counts as a bug in 2to3.py, but when I ran it on my program directory it crashed, with a traceback but without any indication of which file caused the problem. [traceback snipped]

Re: 2to3 chokes on bad character

2011-02-24 Thread Frank Millman
John Machin sjmac...@lexicon.net wrote: On Feb 23, 7:47 pm, Frank Millman fr...@chagford.com wrote: [snip lots of valuable info] The issue is not that 2to3 should handle this correctly, but that it should give a more informative error message to the unsuspecting user. Your Python 2.x code

Re: 2to3 chokes on bad character

2011-02-24 Thread Frank Millman
Peter Otten __pete...@web.de wrote John Machin wrote: Your Python 2.x code should be TESTED before you poke 2to3 at it. In this case just trying to run or import the offending code file would have given an informative syntax error (you have declared the .py file to be encoded in UTF-8 but

Re: Is this a safe use of eval?

2011-02-24 Thread Frank Millman
Christian Heimes li...@cheimes.de wrote Am 24.02.2011 10:01, schrieb Peter Otten: How do you prevent that a malicious source sends you my_string = 'calc_area(__import__(os).system(rm important_file) or 100, 200)' instead? By using something like

Re: Why this difference?

2011-02-24 Thread n00m
Don't rely on it. Hmm I never was about to rely on it. Simply sorta my academic curiosity. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python fails on math

2011-02-24 Thread D'Arcy J.M. Cain
On Thu, 24 Feb 2011 04:56:46 -0800 Ethan Furman et...@stoneleaf.us wrote: The IEEE 754 compliant FPU on most machines today, though, has an 80-bit internal representation. If you do a sequence of operations that retain all the intermediate results in the FPU registers, you get 16 more bits

Today's Hottest actresses

2011-02-24 Thread Ashraf Ali
Hello friends. Would you like to know about bollywood hot and beautiful actresses?You can fine a lot of information about bollywood actresses.Just visit www.hotpics00.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: [PySIL] Securing files

2011-02-24 Thread Software-Develop Philippines
Greetings, The problem isn't so much the database itself, as I can think of a number of way to encrypt the data it contains, but some of the data is simply names of image and video files contained elsewhere in the file-system. Actually, this is something like I had to think through with a

Re: Python fails on math

2011-02-24 Thread Mel
D'Arcy J.M. Cain wrote: On Thu, 24 Feb 2011 04:56:46 -0800 Ethan Furman et...@stoneleaf.us wrote: That's a big if though. Which languages support such a thing? C doubles are 64 bit, same as Python. Assembly! :) Really? Why would you need that level of precision just to gather all

Re: Running Scripts vs Interactive mode

2011-02-24 Thread grobs456
c:\dev\pythonpython HelloWorld.py 'python' is not recognized as an internal or external command, operable program or batch file. #I then tried this for a success!: c:\dev\pythonc:\python27\python.exe HelloWorld.py Hello WOrld! c:\dev\pythonpython HelloWorld.py 'python' is not recognized as an

Re: Running Scripts vs Interactive mode

2011-02-24 Thread Benjamin Kaplan
On Thu, Feb 24, 2011 at 10:34 AM, grobs456 gregory.alexander.robe...@gmail.com wrote: c:\dev\pythonpython HelloWorld.py 'python' is not recognized as an internal or external command, operable program or batch file. #I then tried this for a success!: c:\dev\pythonc:\python27\python.exe

Re: Unload a DLL

2011-02-24 Thread Dave Angel
On 01/-10/-28163 02:59 PM, Sathish S wrote: Hi Ppl, I'm loading a dll using the *cdll.LoadLibrary *function. How can I release the dll after I'm done with it. Are there any functions to do this. Thanks, Sathish In Windows, the FreeLibrary() call will decrement the load count, and unload

Python C Extensions

2011-02-24 Thread aken8...@yahoo.com
Hi, I have a memory leak problem with my C extension module. My C module returns large dictionaries to python, and the dictionaries never get deleted, so the memory for my program keeps growing. I do not know how to delete the dictionary object after it becomes irrelevant. I do not know if the

Re: pattern matching

2011-02-24 Thread Jon Clements
On Feb 24, 2:11 am, monkeys paw mon...@joemoney.net wrote: if I have a string such as 'td01/12/2011/td' and i want to reformat it as '20110112', how do i pull out the components of the string and reformat them into a DDMM format? I have: import re test = re.compile('\d\d\/') f =

py3k: converting int to bytes

2011-02-24 Thread spam
Is there a better way to convert int to bytes then going through strings: x=5 str(x).encode() Thanks. -- Yves. http://www.SollerS.ca/ http://blog.zioup.org/ --

Re: Running Scripts vs Interactive mode

2011-02-24 Thread Dave Angel
On 01/-10/-28163 02:59 PM, grobs456 wrote: snip #I set my system environment variables to: VARIABLEVALUE PYTHON_HOME c:\python27\python.exe PATH...;%PYTHON_HOME% #after also trying this: VARIABLEVALUE PYTHON_HOME

Re: Python C Extensions

2011-02-24 Thread MRAB
On 24/02/2011 16:01, aken8...@yahoo.com wrote: Hi, I have a memory leak problem with my C extension module. My C module returns large dictionaries to python, and the dictionaries never get deleted, so the memory for my program keeps growing. I do not know how to delete the dictionary object

What is the preferred way to sort/compare custom objects?

2011-02-24 Thread Jeremy
I just discovered the wiki page on sorting (http://wiki.python.org/moin/HowTo/Sorting/). This describes the new way of sorting a container instead of using the cmp function. But what do I do for custom objects? If I write __lt__, __gt__, etc. functions for my objects, will these be used?

Re: Python fails on math

2011-02-24 Thread Robert Kern
On 2/24/11 5:55 AM, Steven D'Aprano wrote: On Wed, 23 Feb 2011 13:26:05 -0800, John Nagle wrote: The IEEE 754 compliant FPU on most machines today, though, has an 80-bit internal representation. If you do a sequence of operations that retain all the intermediate results in the FPU registers,

n00b formatting

2011-02-24 Thread Verde Denim
hi, all i can't believe i don't see this, but python from the command line: x = '0D' y = '0x' + x print %d % int(y,0) 13 content of testme.py: x = '0D' y = '0x' + x print %d % int(y,0) TypeError: 'int' object is not callable what am i not seeing here?? --

Preferred method of sorting/comparing custom objects

2011-02-24 Thread Jeremy
I recently found the wiki page on sorting (http://wiki.python.org/moin/HowTo/Sorting/). This page describes the new key parameter to the sort and sorted functions. What about custom objects? Can I just write __lt__, __gt__, etc. functions and not have to worry about the key parameter? Is

Re: Python C Extensions

2011-02-24 Thread aken8...@yahoo.com
Thank you very much, it worked. I thought the PyDict_SetItem should assume ownership of the passed object and decrease it's reference count (I do not know why). Does this also go for the Lists ? Should anything inserted into list also be DECRED-ed ? Thank you again for reply. On Feb 24, 11:33 

Re: What is the preferred way to sort/compare custom objects?

2011-02-24 Thread Jeremy
Sorry for double posting. Google Groups was acting funny this morning. -- http://mail.python.org/mailman/listinfo/python-list

Re: Running Scripts vs Interactive mode

2011-02-24 Thread grobs456
On Feb 24, 11:32 am, Dave Angel da...@ieee.org wrote: On 01/-10/-28163 02:59 PM, grobs456 wrote: snip #I set my system environment variables to: VARIABLE           VALUE PYTHON_HOME                c:\python27\python.exe PATH                       ...;%PYTHON_HOME% #after also

Re: Preferred method of sorting/comparing custom objects

2011-02-24 Thread Jeremy
Sorry for double posting. Google Groups was acting funny this morning. -- http://mail.python.org/mailman/listinfo/python-list

Re: 2to3 chokes on bad character

2011-02-24 Thread Terry Reedy
On 2/24/2011 8:11 AM, Frank Millman wrote: future I will run some tests when betas are released, just in case I come up with something. Please do, perhaps more than once. The test suite coverage is being improved but is not 100%. The day *after* 3.2.0 was released, someone reported an

Re: What is the preferred way to sort/compare custom objects?

2011-02-24 Thread Chris Rebert
On Thu, Feb 24, 2011 at 8:27 AM, Jeremy jlcon...@gmail.com wrote: I just discovered the wiki page on sorting (http://wiki.python.org/moin/HowTo/Sorting/).  This describes the new way of sorting a container instead of using the cmp function.  But what do I do for custom objects?  If I write

Re: Why this difference?

2011-02-24 Thread Terry Reedy
On 2/24/2011 7:19 AM, n00m wrote: file my.txt: === 0 beb 1 qwe 2 asd 3 hyu 4 zed 5 asd 6 oth = py script: === import sys sys.stdin = open('88.txt', 'r') t = sys.stdin.readlines() t = map(lambda rec:

Re: Preferred method of sorting/comparing custom objects

2011-02-24 Thread Chris Rebert
On Thu, Feb 24, 2011 at 8:41 AM, Jeremy jlcon...@gmail.com wrote: I recently found the wiki page on sorting (http://wiki.python.org/moin/HowTo/Sorting/).  This page describes the new key parameter to the sort and sorted functions. What about custom objects?  Can I just write __lt__, __gt__,

Re: n00b formatting

2011-02-24 Thread Chris Rebert
On Thu, Feb 24, 2011 at 8:41 AM, Verde Denim tdl...@gmail.com wrote: hi, all i can't believe i don't see this, but python from the command line: x = '0D' y = '0x' + x print %d % int(y,0) 13 content of testme.py: Is this the *entire* contents of the file? I suspect not, and that somewhere

Re: Python C Extensions

2011-02-24 Thread Carl Banks
On Feb 24, 8:46 am, aken8...@yahoo.com aken8...@yahoo.com wrote: Thank you very much, it worked. I thought the PyDict_SetItem should assume ownership of the passed object and decrease it's reference count (I do not know why). Does this also go for the Lists ? Should anything inserted into

Re: py3k: converting int to bytes

2011-02-24 Thread Terry Reedy
On 2/24/2011 11:19 AM, s...@uce.gov wrote: Is there a better way to convert int to bytes then going through strings: x=5 str(x).encode() (This being Py3) If 0 = x = 9, bytes((ord('0')+n,)) will work. Otherwise, no. You would have to do the same thing str(int) does, which is to reverse the

Re: Preferred method of sorting/comparing custom objects

2011-02-24 Thread Ian Kelly
On Thu, Feb 24, 2011 at 9:41 AM, Jeremy jlcon...@gmail.com wrote: I recently found the wiki page on sorting (http://wiki.python.org/moin/HowTo/Sorting/).  This page describes the new key parameter to the sort and sorted functions. What about custom objects?  Can I just write __lt__, __gt__,

Re: Python C Extensions

2011-02-24 Thread MRAB
On 24/02/2011 16:46, aken8...@yahoo.com wrote: Thank you very much, it worked. I thought the PyDict_SetItem should assume ownership of the passed object and decrease it's reference count (I do not know why). Does this also go for the Lists ? Should anything inserted into list also be DECRED-ed

Re: n00b formatting

2011-02-24 Thread MRAB
On 24/02/2011 16:41, Verde Denim wrote: hi, all i can't believe i don't see this, but python from the command line: x = '0D' y = '0x' + x print %d % int(y,0) 13 content of testme.py: x = '0D' y = '0x' + x print %d % int(y,0) TypeError: 'int' object is not callable what am i not seeing

Re: What is the preferred way to sort/compare custom objects?

2011-02-24 Thread Jeremy
On Thursday, February 24, 2011 10:09:53 AM UTC-7, Chris Rebert wrote: On Thu, Feb 24, 2011 at 8:27 AM, Jeremy jlco...@gmail.com wrote: I just discovered the wiki page on sorting (http://wiki.python.org/moin/HowTo/Sorting/).  This describes the new way of sorting a container instead of

Newbie...

2011-02-24 Thread wisecracker
Hi all... I am new to this list so treat me gently... ;o) I use Python almost totally differently to the vast majority of people. I like banging the metal. As I know of no other way to give my Python code away I thought I`d join here. I only use STANDARD Python, no extras... Here are a

Re: 2to3 chokes on bad character

2011-02-24 Thread John Machin
On Feb 25, 12:00 am, Peter Otten __pete...@web.de wrote: John Machin wrote: Your Python 2.x code should be TESTED before you poke 2to3 at it. In this case just trying to run or import the offending code file would have given an informative syntax error (you have declared the .py file to

Re: Newbie...

2011-02-24 Thread Martin P. Hellwig
On 02/24/11 19:22, wisecrac...@tesco.net wrote: Hi all... I am new to this list so treat me gently... ;o) I for one welcome you :-) I use Python almost totally differently to the vast majority of people. I like banging the metal. Well I can assure you that although you might be indeed in

Re: How can I define __getattr__ to operate on all items of container and pass arguments?

2011-02-24 Thread Jeremy
On Tuesday, February 15, 2011 2:58:11 PM UTC-7, Jeremy wrote: So the arguments haven't yet been passed when __getattr__() is invoked. Instead, you must return a function from __getattr__(); this function will then get called with the arguments. Thus (untested): def __getattr__(self,

share info between methods in a Class

2011-02-24 Thread Garcia, Paul D
What is the best way to access/change list or dictionary information between methods in the same class? Note : I would normally have the input_list originally populate by reading in a file. Currently I have: class Action: def __init__(self): self.input_List = list()

Re: Newbie...

2011-02-24 Thread wisecracker
Hi Martin... I am new to this list so treat me gently... ;o) I for one welcome you :-) Many thanks... Thanks for sharing and happy sharing! Now working on a simple home made seismometer and single channel audio oscilloscope using the recording technique previously posted, all in standard

Re: Why this difference?

2011-02-24 Thread n00m
@nn, @Terry Reedy: Good reading. Thanks. In fact now the case is closed. -- http://mail.python.org/mailman/listinfo/python-list

Suggestion Reqd for Designing a Website in Python

2011-02-24 Thread joy99
Dear Group, I have developed one big Machine Learning software a Machine Translation system in Python. Now, I am thinking to make a User Interface of it and upload it in a web site. My questions are: (i) For Designing an interface I am choosing Tkinter. Is it fine? (ii) How to connect this

Windows 7 Environment Setup - Python, R, mySQL

2011-02-24 Thread grobs456
I am following along with this tutorial/post: http://www.walkerjeff.com/2011/02/python-to-r-via-mysql-on-windows-7-x64/ I am visualizing trying to setup some type of real world data/ interactions and stumbled upon this article. I am also on a 64bit Windows 7 machine. I am rusty in a sense as I

Re: n00b formatting

2011-02-24 Thread Verde Denim
On Thu, Feb 24, 2011 at 12:49 PM, MRAB pyt...@mrabarnett.plus.com wrote: On 24/02/2011 16:41, Verde Denim wrote: hi, all i can't believe i don't see this, but python from the command line: x = '0D' y = '0x' + x print %d % int(y,0) 13 content of testme.py: x = '0D' y = '0x' + x

Re: n00b formatting

2011-02-24 Thread Verde Denim
On Thu, Feb 24, 2011 at 12:23 PM, Chris Rebert c...@rebertia.com wrote: On Thu, Feb 24, 2011 at 8:41 AM, Verde Denim tdl...@gmail.com wrote: hi, all i can't believe i don't see this, but python from the command line: x = '0D' y = '0x' + x print %d % int(y,0) 13 content of

Re: n00b formatting

2011-02-24 Thread Tim Chase
On 02/24/2011 04:46 PM, Verde Denim wrote: On Thu, Feb 24, 2011 at 12:49 PM, MRABpyt...@mrabarnett.plus.com wrote: On 24/02/2011 16:41, Verde Denim wrote: x = '0D' y = '0x' + x print %d % int(y,0) TypeError: 'int' object is not callable what am i not seeing here?? I can only assume that

Re: Why this difference?

2011-02-24 Thread Steven D'Aprano
On Thu, 24 Feb 2011 13:58:28 +0100, Paul Anton Letnes wrote: Den 24.02.11 13.41, skrev n00m: The 1st False is not surprising for me. It's the 2nd True is a bit hmmm... ok, it doesn't matter == Have a nice day! I am no expert, but I think python re-uses some integer and

Re: Python fails on math

2011-02-24 Thread Steven D'Aprano
On Thu, 24 Feb 2011 10:40:45 -0600, Robert Kern wrote: On 2/24/11 5:55 AM, Steven D'Aprano wrote: On Wed, 23 Feb 2011 13:26:05 -0800, John Nagle wrote: The IEEE 754 compliant FPU on most machines today, though, has an 80-bit internal representation. If you do a sequence of operations that

Re: Newbie...

2011-02-24 Thread Steven D'Aprano
On Thu, 24 Feb 2011 19:22:52 +, wisecracker wrote: As I know of no other way to give my Python code away I thought I`d join here. It would be far more appropriate to *ask* where to put your code *first* rather than to just dump 350+ lines of double-spaced(!) code into people's inboxes,

Re: lxml

2011-02-24 Thread alex23
On Feb 24, 6:20 pm, Stefan Behnel stefan...@behnel.de wrote: MRAB, 24.02.2011 01:25: The latest stable release is here: http://pypi.python.org/pypi/lxml/2.2.8 Not quite the latest stable release (that would be 2.3), but at least one that's pre-built for Windows. Christoph Gohlke has an

Re: Python fails on math

2011-02-24 Thread Westley Martínez
On Fri, 2011-02-25 at 00:33 +, Steven D'Aprano wrote: On Thu, 24 Feb 2011 10:40:45 -0600, Robert Kern wrote: On 2/24/11 5:55 AM, Steven D'Aprano wrote: On Wed, 23 Feb 2011 13:26:05 -0800, John Nagle wrote: The IEEE 754 compliant FPU on most machines today, though, has an 80-bit

Re: Python fails on math

2011-02-24 Thread Grant Edwards
On 2011-02-25, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: C double *variables* are, but as John suggests, C compilers are allowed (to my knowledge) to keep intermediate results of an expression in the larger-precision FPU registers. The final result does get shoved back into

Re: Python fails on math

2011-02-24 Thread Grant Edwards
On 2011-02-25, Westley Mart?nez aniko...@gmail.com wrote: Maybe I'm wrong, but wouldn't compiling Python with a compiler that supports extended precision for intermediates allow Python to use extended precision for its immediates? I'm not sure what you mean by immediates, but I don't think

Re: Python fails on math

2011-02-24 Thread Westley Martínez
On Fri, 2011-02-25 at 00:57 +, Grant Edwards wrote: On 2011-02-25, Westley Mart?nez aniko...@gmail.com wrote: Maybe I'm wrong, but wouldn't compiling Python with a compiler that supports extended precision for intermediates allow Python to use extended precision for its immediates?

Re: py3k: converting int to bytes

2011-02-24 Thread John Machin
On Feb 25, 4:39 am, Terry Reedy wrote: Note: an as yet undocumented feature of bytes (at least in Py3) is that bytes(count) == bytes()*count == b'\x00'*count. Python 3.1.3 docs for bytes() say same constructor args as for bytearray(); this says about the source parameter: If it is an integer,

Re: Is this a safe use of eval?

2011-02-24 Thread Nobody
On Thu, 24 Feb 2011 15:24:51 +0200, Frank Millman wrote: Thanks, Christian. I had a look at that recipe, but I must say that Paul's suggestion is much simpler - from ast import literal_eval method_name = 'calc_area' args = literal_eval('(100,200)') result = getattr(my_inst,

Re: py3k: converting int to bytes

2011-02-24 Thread Terry Reedy
On 2/24/2011 9:25 PM, John Machin wrote: On Feb 25, 4:39 am, Terry Reedy wrote: Note: an as yet undocumented feature of bytes (at least in Py3) is that bytes(count) == bytes()*count == b'\x00'*count. Python 3.1.3 docs for bytes() say same constructor args as for bytearray(); this says about

Re: wxPython SQLite and Reportlab demo

2011-02-24 Thread Tim Roberts
Beppe giuseppecosta...@gmail.com wrote: I would recommend this my little work on sourceforge. http://sourceforge.net/projects/pyggybank/ you can download an exe (pyggy_w32.7z) make with py2exe and the source (pyggy_source.7z) the project is named Pyggy Bank. Nowhere, in either this

Re: Suggestion Reqd for Designing a Website in Python

2011-02-24 Thread Tim Roberts
joy99 subhakolkata1...@gmail.com wrote: Dear Group, I have developed one big Machine Learning software a Machine Translation system in Python. Now, I am thinking to make a User Interface of it and upload it in a web site. Do you mean you want people to download this from a web site as an

[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')

2011-02-24 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: Alexander Belopolsky wrote: Alexander Belopolsky belopol...@users.sourceforge.net added the comment: In issue11303.diff, I add similar optimization for encode('latin1') and for 'utf8' variant of utf-8. I don't think dash-less

[issue5902] Stricter codec names

2011-02-24 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: Alexander Belopolsky wrote: Alexander Belopolsky belopol...@users.sourceforge.net added the comment: What is the status of this. Status=open and Resolution=rejected contradict each other. Sorry, forgot to close the ticket.

[issue5902] Stricter codec names

2011-02-24 Thread Marc-Andre Lemburg
Changes by Marc-Andre Lemburg m...@egenix.com: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5902 ___ ___

[issue5902] Stricter codec names

2011-02-24 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: Alexander Belopolsky wrote: Alexander Belopolsky belopol...@users.sourceforge.net added the comment: Accepting all common forms for encoding names means that you can usually give Python an encoding name from, e.g. a HTML page, or any

[issue11295] On Windows, Python crashes on ANSI / Windows-formatted source files

2011-02-24 Thread Stefan Krah
Stefan Krah stefan-use...@bytereef.org added the comment: Python works fine with Notepad generated scripts. I think this is a CGI issue. Try following this tutorial: http://www.imladris.com/Scripts/PythonForWindows.html If you still suspect a bug, you should provide the exact CGI script and

[issue5902] Stricter codec names

2011-02-24 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: Alexander Belopolsky wrote: Alexander Belopolsky belopol...@users.sourceforge.net added the comment: Ezio and I discussed on IRC the implementation of alias lookup and neither of us was able to point out to the function that strips

[issue11296] Possible error in What's new in Python 3.2 : duplication of rsplit() mention

2011-02-24 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Okay fixed. The rsplit() method was mentioned in both underlying tracker issues, so it got mentioned twice when once would have been enough :-) -- assignee: docs@python - rhettinger nosy: +rhettinger priority:

[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')

2011-02-24 Thread Steffen Daode Nurpmeso
Steffen Daode Nurpmeso sdao...@googlemail.com added the comment: I wonder what this normalize_encoding() does! Here is a pretty standard version of mine which is a bit more expensive but catches match more cases! This is stripped, of course, and can be rewritten very easily to Python's needs

[issue11197] information leakage with SimpleHTTPServer

2011-02-24 Thread david
david db.pub.m...@gmail.com added the comment: This may be stupid but... shouldn't the example be: lynx http://localhost:8000/../../../../../etc/passwd ... which does _not_ work. -- nosy: +db ___ Python tracker rep...@bugs.python.org

[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')

2011-02-24 Thread Steffen Daode Nurpmeso
Steffen Daode Nurpmeso sdao...@googlemail.com added the comment: (That is to say, i would do it. But not if _cpython is thrown to trash ,-); i.e. not if there is not a slight chance that it gets actually patched in because this performance issue probably doesn't mean a thing in real life.

[issue11307] re engine exhaustively explores more than necessary

2011-02-24 Thread Niko Matsakis
New submission from Niko Matsakis n...@alum.mit.edu: Executing code like this: r = re.compile(r'(\w+)*=.*') r.match(abcdefghijklmnopqrstuvwxyz) takes a long time (around 12 seconds, on my machine). Presumably this is because it is enumerating all the various ways to divvy up the alphabet

[issue4350] Remove dead code from Tkinter.py

2011-02-24 Thread Graham Horler
Graham Horler tryexc...@gmail.com added the comment: Are we sure this is dead code, and not just out of date? e.g. this works, and I use it in production with if Tkinter.TkVersion = 8.4: b = Tkinter.Button(root) b.tk.call('tk::ButtonEnter', b._w) -- nosy: +pysquared

[issue11308] extraneous link getit in the main website sidebar

2011-02-24 Thread SilentGhost
New submission from SilentGhost ghost@gmail.com: There is an extraneous entry in sidebar of the www.python.org It has some two chinese characters and leads to download page. -- messages: 129264 nosy: SilentGhost priority: normal severity: normal status: open title: extraneous link

[issue11308] extraneous link getit in the main website sidebar

2011-02-24 Thread SilentGhost
SilentGhost ghost@gmail.com added the comment: Sorry, I realise that this is my mistake. -- resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11308

[issue11309] #include wctype.h in Objects/unicodetype_db.h and Objects/unicodectype.c

2011-02-24 Thread Дилян Палаузов
New submission from Дилян Палаузов dilyan.palau...@aegee.org: As of python 2.7.1 configured with --enable-ipv6 --enable-unicode --with-system-expat --with-system-ffi --with-signal-module --with-threads --with-wctype-functions --enable-shared: Please #include wctype.h in

[issue11309] #include wctype.h in Objects/unicodetype_db.h and Objects/unicodectype.c

2011-02-24 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: Дилян Палаузов wrote: New submission from Дилян Палаузов dilyan.palau...@aegee.org: As of python 2.7.1 configured with --enable-ipv6 --enable-unicode --with-system-expat --with-system-ffi --with-signal-module --with-threads

  1   2   >