Introduction to Python, July 13-15, 2010 (Chicago)

2010-07-07 Thread David Beazley
Introduction to Python Programming with David Beazley, author Python Essential Reference http://www.dabeaz.com/chicago/index.html July 13-15, 2010 Chicago, Illinois

]ANN] Selenium Python bindings dev-9231

2010-07-07 Thread Miki
Hello All, The latest version of Selenium Python bindings (dev-9231 on PyPI) includes the native Firefox driver. You can now can do: from selenium import get_driver, FIREFOX driver = get_driver(FIREFOX) driver.get(http://www.google.com;) ... To get the latest version, just run

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Tim Roberts
sturlamolden sturlamol...@yahoo.no wrote: Just a little reminder: Microsoft has withdrawn VS2008 in favor of VS2010. Nonsense. They have released VS2010, but they certainly have not withdrawn VS2008, and I have heard of no plans to do so. The express version is also unavailable for download.

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Stephen Hansen
On 7/6/10 11:21 PM, Tim Roberts wrote: sturlamolden sturlamol...@yahoo.no wrote: Just a little reminder: Microsoft has withdrawn VS2008 in favor of VS2010. Nonsense. They have released VS2010, but they certainly have not withdrawn VS2008, and I have heard of no plans to do so. Its not

Re: Python as a scripting language. Alternative to bash script?

2010-07-07 Thread Stefan Behnel
John Nagle, 28.06.2010 19:57: Programs have argv and argc, plus environment variables, going in. So, going in, there are essentially subroutine parameters. But all that comes back is an exit code. They should have had something similar coming back, with arguments to exit() returning the results.

Python 3 - Is PIL/wxPython/PyWin32 supported?

2010-07-07 Thread durumdara
Hi! I have an environment under Python 2.6 (WinXP). That is based on PIL, wxPython/PyWin32. In the project's pages I see official installer for only PyWin32. I don't know that PIL or wxPython supports Python 3 or not. May with some trick these packages are working. Does anybody know about it?

Re: Plot problem.. ?? No sign at all

2010-07-07 Thread Johan Grönqvist
2010-07-06 19:18, Ritchy lelis skrev: On 6 jul, 17:29, Alan G Isaacalan.is...@gmail.com wrote: Unfortunately I cannot make sense of the code you posted. Provide a detailed description in words (or psuedocode) of what you are trying to accomplish. Be very careful and detailed is you want a

Re: The real problem with Python 3 - no business case for conversion (was I strongly dislike Python 3)

2010-07-07 Thread Paul McGuire
On Jul 6, 3:30 am, David Cournapeau courn...@gmail.com wrote: On Tue, Jul 6, 2010 at 4:30 AM, D'Arcy J.M. Cain da...@druid.net wrote: One thing that would be very useful is how to maintain something that works on 2.x and 3.x, but not limiting yourself to 2.6. Giving up versions below 2.6 is

Re: The real problem with Python 3 - no business case for conversion

2010-07-07 Thread Paul Rubin
Paul McGuire pt...@austin.rr.com writes: is completely forward and backward incompatible. The workaround is to rewrite as: except ExceptionType: ex = sys.exc_info()[0] which works just fine in 2.x and 3.x. Are you sure? I wonder if there might be some race condition that

Re: The real problem with Python 3 - no business case for conversion

2010-07-07 Thread Thomas Jollans
On 07/07/2010 10:58 AM, Paul Rubin wrote: Paul McGuire pt...@austin.rr.com writes: is completely forward and backward incompatible. The workaround is to rewrite as: except ExceptionType: ex = sys.exc_info()[0] which works just fine in 2.x and 3.x. Are you sure? I wonder if

Re: The real problem with Python 3 - no business case for conversion (was I strongly dislike Python 3)

2010-07-07 Thread geremy condra
On Tue, Jul 6, 2010 at 1:37 AM, Terry Reedy tjre...@udel.edu wrote: On 7/5/2010 9:00 PM, Philip Semanchuk wrote: On Jul 5, 2010, at 6:41 PM, Chris Rebert wrote: On Mon, Jul 5, 2010 at 3:38 PM, Philip Semanchuk I ported two pure C extensions from 2 to 3 and was even able to keep a single C

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Jonathan Hartley
On Jul 6, 4:50 pm, sturlamolden sturlamol...@yahoo.no wrote: Just a little reminder: Microsoft has withdrawn VS2008 in favor of VS2010. The express version is also unavailable for download. :(( We can still get a VC++ 2008 compiler required to build extensions for the official Python 2.6

Problem With the PyRtf Footers

2010-07-07 Thread srinivas hn
Hi all, Am using the pyrtf for the generating the rtf documents from the html.Am able to generate the documents the problem is with the footer.Its coming only for the first page for the rest of the pages it is coming empty.Am using the section.FirstFooter for the first page footer and

Python -- floating point arithmetic

2010-07-07 Thread david mainzer
Dear Python-User, today i create some slides about floating point arithmetic. I used an example from http://docs.python.org/tutorial/floatingpoint.html so i start the python shell on my linux machine: d...@maxwell $ python Python 2.6.5 (release26-maint, May 25 2010, 12:37:06) [GCC 4.3.4] on

Python -- floating point arithmetic

2010-07-07 Thread david mainzer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA384 Dear Python-User, today i create some slides about floating point arithmetic. I used an example from http://docs.python.org/tutorial/floatingpoint.html so i start the python shell on my linux machine: d...@maxwell $ python Python 2.6.5

Re: Recommend a MySQLdb Forum

2010-07-07 Thread Philip Semanchuk
On Jul 6, 2010, at 3:16 PM, Tim Johnson wrote: Greetings: I would appreciate it if some could recommend a MySQLdb forum. The one associated the sourceforge project seems like a good bet. 1) go here: http://sourceforge.net/projects/mysql-python/ 2) click support --

Re: Python -- floating point arithmetic

2010-07-07 Thread Mark Dickinson
On Jul 7, 1:05 pm, david mainzer d...@tu-clausthal.de wrote: Dear Python-User, today i create some slides about floating point arithmetic. I used an example from http://docs.python.org/tutorial/floatingpoint.html so i start the python shell on my linux machine: d...@maxwell $ python

Re: Python -- floating point arithmetic

2010-07-07 Thread Thomas Jollans
On 07/07/2010 02:05 PM, david mainzer wrote: today i create some slides about floating point arithmetic. I used an example from http://docs.python.org/tutorial/floatingpoint.html so i start the python shell on my linux machine: d...@maxwell $ python Python 2.6.5 (release26-maint, May

Re: Python -- floating point arithmetic

2010-07-07 Thread Christian Heimes
can anybody tell me how python internal represent a float number?? It's an IEEE 754 double precision float on all hardware platforms that support IEEE 754 semantics. Python follows the C99 standards for double and complex numbers. Christian --

Re: C interpreter in Lisp/scheme/python

2010-07-07 Thread Richard Bos
Tim Rentsch t...@alumni.caltech.edu wrote: nanothermite911fbibustards nanothermite911fbibusta...@gmail.com How to make Lisp go faster than C Didier Verna Asking whether Lisp is faster than C is like asking why it's colder in the mountains than it is in the summer. YM warmer. HTH;

Re: Python 3 - Is PIL/wxPython/PyWin32 supported?

2010-07-07 Thread Daniel Fetchinson
I don't know that PIL or wxPython supports Python 3 or not. May with some trick these packages are working. Does anybody know about it? Can I replace my Py2.6 without lost PIL/wxPython? PIL currently does not support python 3 but release 1.1.7 will in the future. Don't ask me when, I don't

Re: Python -- floating point arithmetic

2010-07-07 Thread Philip Semanchuk
On Jul 7, 2010, at 9:08 AM, Thomas Jollans wrote: On 07/07/2010 02:05 PM, david mainzer wrote: today i create some slides about floating point arithmetic. I used an example from http://docs.python.org/tutorial/floatingpoint.html so i start the python shell on my linux machine: d...@maxwell

Re: Why Python forbids multiple instances of one module?

2010-07-07 Thread CHEN Guang
Why Python forbids multiple instances of one module? If only Python allows multiple instances of one module, module will be enough to replace class in most cases. After all, it is much easier to write a module than a class, at least we do not have to write self everywhere. If you really

Re: Python -- floating point arithmetic

2010-07-07 Thread bart.c
david mainzer wrote: sum = 0.0 for i in range(10): ... sum += 0.1 ... sum 0.99989 But thats looks a little bit wrong for me ... i must be a number greater then 1.0 because 0.1 = 0.155511151231257827021181583404541015625000 in python ... if i print

Re: Python -- floating point arithmetic

2010-07-07 Thread bart.c
david mainzer wrote: sum = 0.0 for i in range(10): ... sum += 0.1 ... sum 0.99989 But thats looks a little bit wrong for me ... i must be a number greater then 1.0 because 0.1 = 0.155511151231257827021181583404541015625000 in python ... if i print

Re: C interpreter in Lisp/scheme/python

2010-07-07 Thread Michele Simionato
On Jun 14, 1:07 am, bolega gnuist...@gmail.com wrote: I am trying to compare LISP/Scheme/Python for their expressiveness. For this, I propose a vanilla C interpreter. I have seen a book which writes C interpreter in C. The criteria would be the small size and high readability of the code.

Error message repetition

2010-07-07 Thread Tambet
Hello! I have such problem that: - My console shows maximally x last lines, then truncates - Error message takes 2 line - In case of very big stack trace, there will be 2*x error lines - In such case I do not see any debug output In this case, it's about recursion: File b2.py,

tarfile and progress information

2010-07-07 Thread Nathan Huesken
Hi, I am packing large files with tarfile. Is there any way I can get progress information while packing? Thanks! Nathan -- http://mail.python.org/mailman/listinfo/python-list

Re: The real problem with Python 3 - no business case for conversion (was I strongly dislike Python 3)

2010-07-07 Thread Kevin Walzer
On 7/2/10 3:07 PM, John Nagle wrote: That's the real issue, not parentheses on the print statement. Where's the business case for moving to Python 3? It's not faster. It doesn't do anything you can't do in Python 2.6. There's no killer app for it. End of life for Python 2.x is many years away;

Re: Error message repetition

2010-07-07 Thread Thomas Jollans
On 07/07/2010 05:10 PM, Tambet wrote: Hello! I have such problem that: * My console shows maximally x last lines, then truncates * Error message takes 2 line * In case of very big stack trace, there will be 2*x error lines * In such case I do not see any debug output

Re: Python as a scripting language. Alternative to bash script?

2010-07-07 Thread Michael Torrie
On 07/06/2010 09:34 PM, Chris Rebert wrote: On Tue, Jul 6, 2010 at 6:40 AM, Michael Torrie torr...@gmail.com wrote: While it's possible to set up pipes and spawn programs in parallel to operate on the pipes, in practice it's simpler to tell subprocess.Popen to use a shell and then just rely on

Re: Error message repetition

2010-07-07 Thread Tambet
Depending on how far this goes up, you might just be able to change the backlog your terminal emulator saves? that would allow you to scroll up. If you can't do that, you should get a proper console. I use bash, which allows to do that. This was rather a case example - actually this output

Re: Python -- floating point arithmetic

2010-07-07 Thread Nobody
On Wed, 07 Jul 2010 15:08:07 +0200, Thomas Jollans wrote: you should never rely on a floating-point number to have exactly a certain value. Never is an overstatement. There are situations where you can rely upon a floating-point number having exactly a certain value. First, floating-point

Re: C interpreter in Lisp/scheme/python

2010-07-07 Thread Rivka Miller
On Jun 13, 4:07 pm, bolega gnuist...@gmail.com wrote: I am trying to compare LISP/Scheme/Python for their expressiveness. For this, I propose a vanilla C interpreter. I have seen a book which writes C interpreter in C. The criteria would be the small size and high readability of the code.

Re: The real problem with Python 3 - no business case for conversion (was I strongly dislike Python 3)

2010-07-07 Thread Roy Smith
In article 5325a$4c349b5b$4275d90a$27...@fuse.net, Kevin Walzer k...@codebykevin.com wrote: That's decision for each business to make. My guess is that many businesses won't upgrade for some time, until the major libraries/modules support Python 3. I don't plan to move to Python 3 for at

Re: C interpreter in Lisp/scheme/python

2010-07-07 Thread wolfgang.riedel
On 20 June, 03:48, Tim Rentsch t...@alumni.caltech.edu wrote: nanothermite911fbibustards nanothermite911fbibusta...@gmail.com writes: Asking whether Lisp is faster than C is like asking why it's colder in the mountains than it is in the summer. original Karl Valentin would be colder outside

Re: Python -- floating point arithmetic

2010-07-07 Thread Ethan Furman
Nobody wrote: On Wed, 07 Jul 2010 15:08:07 +0200, Thomas Jollans wrote: you should never rely on a floating-point number to have exactly a certain value. Never is an overstatement. There are situations where you can rely upon a floating-point number having exactly a certain value. It's not

Re: Python 3 - Is PIL/wxPython/PyWin32 supported?

2010-07-07 Thread Giampaolo Rodolà
2010/7/7 durumdara durumd...@gmail.com: Hi! I have an environment under Python 2.6 (WinXP). That is based on PIL, wxPython/PyWin32. In the project's pages I see official installer for only PyWin32. I don't know that PIL or wxPython supports Python 3 or not. May with some trick these

Re: Python -- floating point arithmetic

2010-07-07 Thread Raymond Hettinger
On Jul 7, 5:55 am, Mark Dickinson dicki...@gmail.com wrote: On Jul 7, 1:05 pm, david mainzer d...@tu-clausthal.de wrote: Dear Python-User, today i create some slides about floating point arithmetic. I used an example from http://docs.python.org/tutorial/floatingpoint.html so i

Re: Python as a scripting language. Alternative to bash script?

2010-07-07 Thread Chris Rebert
On Wed, Jul 7, 2010 at 8:31 AM, Michael Torrie torr...@gmail.com wrote: On 07/06/2010 09:34 PM, Chris Rebert wrote: On Tue, Jul 6, 2010 at 6:40 AM, Michael Torrie torr...@gmail.com wrote: While it's possible to set up pipes and spawn programs in parallel to operate on the pipes, in practice

Is This Open To SQL Injection?

2010-07-07 Thread Victor Subervi
Hi; I have this code: sql = 'insert into personalDataKeys values (%s, %s, %s)' % (store, user, ', %s'.join('%s' * len(col_vals)) cursor.execute(sql, col_vals) Is this open to injection attacks? If so, how correct? TIA, beno -- http://mail.python.org/mailman/listinfo/python-list

Re: Is This Open To SQL Injection?

2010-07-07 Thread Stephen Hansen
On 7/7/10 11:38 AM, Victor Subervi wrote: Hi; I have this code: sql = 'insert into personalDataKeys values (%s, %s, %s)' % (store, user, ', %s'.join('%s' * len(col_vals)) cursor.execute(sql, col_vals) First, its always best to be explicit with insert statements. Meaning, don't rely

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread sturlamolden
On 7 Jul, 11:32, Jonathan Hartley tart...@tartley.com wrote: Also, this would solve the pain of Python developers attempting to redistribute py2exe versions of their programs (i.e. they have to own a Visual Studio license to legally be able to redistribute the required C runtime)

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Martin v. Loewis
Python 3.1.1, file [pymem.h]: PyAPI_FUNC(void *) PyMem_Malloc(size_t); #define PyMem_MALLOC(n)(((n) 0 || (n) PY_SSIZE_T_MAX) ? NULL \ : malloc((n) ? (n) : 1)) The problem with the latter that it seems that it's intended for safety but does the opposite... Why

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread sturlamolden
On 7 Jul, 06:54, Alf P. Steinbach /Usenet alf.p.steinbach +use...@gmail.com wrote: PyAPI_FUNC(void *) PyMem_Malloc(size_t); #define PyMem_MALLOC(n)         (((n) 0 || (n) PY_SSIZE_T_MAX) ? NULL \                                 : malloc((n) ? (n) : 1)) I was afraid of that :( Except

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Martin v. Loewis
I presume this problem would go away if future versions of Python itself were compiled on Windows with something like MinGW gcc. Also, this would solve the pain of Python developers attempting to redistribute py2exe versions of their programs (i.e. they have to own a Visual Studio license to

Re: Is This Open To SQL Injection?

2010-07-07 Thread MRAB
Stephen Hansen wrote: On 7/7/10 11:38 AM, Victor Subervi wrote: Hi; I have this code: sql = 'insert into personalDataKeys values (%s, %s, %s)' % (store, user, ', %s'.join('%s' * len(col_vals)) cursor.execute(sql, col_vals) First, its always best to be explicit with insert statements.

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread sturlamolden
On 7 Jul, 21:12, sturlamolden sturlamol...@yahoo.no wrote: #define PyMem_MALLOC(n)         (((n) 0 || (n) PY_SSIZE_T_MAX) ? NULL \                                 : malloc((n) ? (n) : 1)) I was afraid of that :( Also observe that this macro is very badly written (even illegal) C.

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Alf P. Steinbach /Usenet
* Martin v. Loewis, on 07.07.2010 21:10: Python 3.1.1, file [pymem.h]: PyAPI_FUNC(void *) PyMem_Malloc(size_t); #define PyMem_MALLOC(n)(((n) 0 || (n) PY_SSIZE_T_MAX) ? NULL \ : malloc((n) ? (n) : 1)) The problem with the latter that it seems that it's intended for

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Alf P. Steinbach /Usenet
* sturlamolden, on 07.07.2010 21:12: On 7 Jul, 06:54, Alf P. Steinbach /Usenetalf.p.steinbach +use...@gmail.com wrote: PyAPI_FUNC(void *) PyMem_Malloc(size_t); #define PyMem_MALLOC(n) (((n) 0 || (n) PY_SSIZE_T_MAX) ? NULL \ : malloc((n) ? (n) : 1))

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread sturlamolden
On 7 Jul, 21:41, Alf P. Steinbach /Usenet alf.p.steinbach +use...@gmail.com wrote: You still have two CRTs linked into the same process. So? CRT resources cannot be shared across CRT borders. That is the problem. Multiple CRTs are not a problem if CRT resources are never shared. --

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Martin v. Loewis
Also observe that this macro is very badly written (even illegal) C. Consider what this would do: PyMem_MALLOC(n++) According to Linus Thorvalds using macros like this is not even legal C: http://www.linuxfocus.org/common/src/January2004_linus.html [Please don't use legal wrt.

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread sturlamolden
On 7 Jul, 21:47, Martin v. Loewis mar...@v.loewis.de wrote: That would partially defeat the purpose, namely it would require the compiler to put the size into a variable in memory, and possibly prevent optimizations from taking place that rely on constant propagation (depending on how smart

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Martin v. Loewis
Perhaps (if it isn't intentional) this is a bug of the oversight type, that nobody remembered to update the macro? Update in what way? I was guessing that at one time there was no PyMem_Malloc. And that it was introduced to fix Windows-specific problems, but inadvertently without updating

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Alf P. Steinbach /Usenet
* sturlamolden, on 07.07.2010 21:46: On 7 Jul, 21:41, Alf P. Steinbach /Usenetalf.p.steinbach +use...@gmail.com wrote: You still have two CRTs linked into the same process. So? CRT resources cannot be shared across CRT borders. That is the problem. Multiple CRTs are not a problem if CRT

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Alf P. Steinbach /Usenet
* Martin v. Loewis, on 07.07.2010 21:56: Perhaps (if it isn't intentional) this is a bug of the oversight type, that nobody remembered to update the macro? Update in what way? I was guessing that at one time there was no PyMem_Malloc. And that it was introduced to fix Windows-specific

Re: Is This Open To SQL Injection?

2010-07-07 Thread Ian
On 07/07/2010 19:38, Victor Subervi wrote: Hi; I have this code: sql = 'insert into personalDataKeys values (%s, %s, %s)' % (store, user, ', %s'.join('%s' * len(col_vals)) cursor.execute(sql, col_vals) Is this open to injection attacks? If so, how correct? TIA, beno Yes, it is

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread sturlamolden
On 7 Jul, 21:47, Martin v. Loewis mar...@v.loewis.de wrote: However, the C standard is silent wrt. to PyMem_MALLOC, and it certainly allows the definition of macros which use the macro arguments more than once. Ok, I knew there was something odd here. PyMem_Malloc is indeed a function, whilst

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Grant Edwards
On 2010-07-07, Martin v. Loewis mar...@v.loewis.de wrote: Also observe that this macro is very badly written (even illegal) C. Consider what this would do: PyMem_MALLOC(n++) According to Linus Thorvalds using macros like this is not even legal C:

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Christian Heimes
Yeah, but then we're down to file descriptors, C library locales and such as the remaining problems. Don't forget errno! Every CRT might have its own errno thread local. I don't know how its handled on Windows but I suspect it suffers from the same problem. Christia --

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread sturlamolden
On 7 Jul, 22:26, Christian Heimes li...@cheimes.de wrote: Don't forget errno! Every CRT might have its own errno thread local. I don't know how its handled on Windows but I suspect it suffers from the same problem. The Windows API errno is GetLastError. But a delinquent CRT might map

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Christian Heimes
The main problem that the required MSVC redistributables are not necessarily present on the end user's system. It's not a problem for Python anymore. It took a while to sort all problems out. Martin and other developers have successfully figured out how to install the CRT for system wide and

Re: The real problem with Python 3 - no business case for conversion (was I strongly dislike Python 3)

2010-07-07 Thread Carl Banks
On Jul 7, 1:31 am, Paul McGuire pt...@austin.rr.com wrote: On Jul 6, 3:30 am, David Cournapeau courn...@gmail.com wrote: On Tue, Jul 6, 2010 at 4:30 AM, D'Arcy J.M. Cain da...@druid.net wrote: One thing that would be very useful is how to maintain something that works on 2.x and 3.x, but

Fascinating interview by Richard Stallman on Russia TV

2010-07-07 Thread bolega
Democracy is sick in the US, government monitors your Internet http://www.youtube.com/watch?v=2BfCJq_zIdkfeature=fvsr Enjoy . -- http://mail.python.org/mailman/listinfo/python-list

Fascinating interview by Richard Stallman on Russia TV

2010-07-07 Thread bolega
Democracy is sick in the US, government monitors your Internet http://www.youtube.com/watch?v=2BfCJq_zIdkfeature=fvsr Enjoy . -- http://mail.python.org/mailman/listinfo/python-list

Re: The real problem with Python 3 - no business case for conversion (was I strongly dislike Python 3)

2010-07-07 Thread Brendan Abel
One thing that would be very useful is how to maintain something that works on 2.x and 3.x, but not limiting yourself to 2.6. Giving up versions below 2.6 is out of the question for most projects with a significant userbase IMHO. As such, the idea of running the python 3 warnings is

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Alf P. Steinbach /Usenet
* Christian Heimes, on 07.07.2010 22:47: The main problem that the required MSVC redistributables are not necessarily present on the end user's system. It's not a problem for Python anymore. It took a while to sort all problems out. Martin and other developers have successfully figured out how

Re: Recommend a MySQLdb Forum

2010-07-07 Thread Tim Johnson
On 2010-07-07, Philip Semanchuk phi...@semanchuk.com wrote: On Jul 6, 2010, at 3:16 PM, Tim Johnson wrote: Greetings: I would appreciate it if some could recommend a MySQLdb forum. The one associated the sourceforge project seems like a good bet. 1) go here:

Re: SMTPHandler and Unicode

2010-07-07 Thread norbert
Well, you could use an approach like the one suggested here: http://plumberjack.blogspot.com/2010/07/using-custom-formatter-to-dea... That's nice, thanks. I'll use something like this. Just a thought : I will use errors=replace in the call to the encode method to be sure that the logger does

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Martin v. Loewis
Am 07.07.2010 22:35, schrieb sturlamolden: On 7 Jul, 22:26, Christian Heimes li...@cheimes.de wrote: Don't forget errno! Every CRT might have its own errno thread local. I don't know how its handled on Windows but I suspect it suffers from the same problem. The Windows API errno is

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Alf P. Steinbach /Usenet
* Alf P. Steinbach /Usenet, on 07.07.2010 23:19: However developing an extension with MSVC 10 the extension will use the 10.0 CRT, which is not necessarily present on the end user's system. As I see it there are five solutions with different trade-offs: A Already having Visual Studio 2008

Storing a callback function as a class member

2010-07-07 Thread Nathan Huesken
Hi, I have a class, where I want to store a callback function as a member to access later: class CallbackClass: def setCallback(self,cb): self.cb = cb def callCallback(self, para): self.cb(para) Doing so, I get the error: callbackFunc() takes exactly 1 parameter (2

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread sturlamolden
On 7 Jul, 23:33, Martin v. Loewis mar...@v.loewis.de wrote: The Windows API errno is GetLastError. But a delinquent CRT might map GetLastError() to other integers. Please check the source before posting. msvcrt defines errno as I don't have the source to msvcrt, at least not to my

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Martin v. Loewis
Am 07.07.2010 23:49, schrieb sturlamolden: On 7 Jul, 23:33, Martin v. Loewis mar...@v.loewis.de wrote: The Windows API errno is GetLastError. But a delinquent CRT might map GetLastError() to other integers. Please check the source before posting. msvcrt defines errno as I don't have the

Re: The real problem with Python 3 - no business case for conversion (was I strongly dislike Python 3)

2010-07-07 Thread MRAB
Brendan Abel wrote: One thing that would be very useful is how to maintain something that works on 2.x and 3.x, but not limiting yourself to 2.6. Giving up versions below 2.6 is out of the question for most projects with a significant userbase IMHO. As such, the idea of running the python 3

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread sturlamolden
On 7 Jul, 23:19, Alf P. Steinbach /Usenet alf.p.steinbach +use...@gmail.com wrote:    D Linking the CRT dynamically and providing an optional download and      install of the redistributables if they're not present. This would      best be done with some support from the Python installation

How to test/troubshoot an extension (pylibconfig)?

2010-07-07 Thread Grant Edwards
I'm trying to use python bindings for libconfig. There appear to be three very slightly different bindings: http://code.google.com/p/python-libconfig/ http://wiki.github.com/cnangel/python-libconfig/ http://github.com/azeey/python-libconfig/ I'm using the latter with libconfig 1.4.5

Re: Storing a callback function as a class member

2010-07-07 Thread MRAB
Nathan Huesken wrote: Hi, I have a class, where I want to store a callback function as a member to access later: class CallbackClass: def setCallback(self,cb): self.cb = cb def callCallback(self, para): self.cb(para) Doing so, I get the error: callbackFunc() takes

Re: The real problem with Python 3 - no business case for conversion

2010-07-07 Thread John Bokma
John Nagle na...@animats.com writes: Python 3 is a nice cleanup of some legacy syntax issues. But that's just not enough. Perl 6 is a nice cleanup of Perl 5, Eh, I wouldn't call Perl 6 a nice cleanup. It's much better to consider it a new language with roots in Perl 5 (amongst others). Or

Re: How to test/troubshoot an extension (pylibconfig)?

2010-07-07 Thread Grant Edwards
On 2010-07-07, Grant Edwards inva...@invalid.invalid wrote: I'm trying to use python bindings for libconfig. There appear to be three very slightly different bindings: http://code.google.com/p/python-libconfig/ http://wiki.github.com/cnangel/python-libconfig/

Re: Storing a callback function as a class member

2010-07-07 Thread Rhodri James
On Wed, 07 Jul 2010 22:48:11 +0100, Nathan Huesken pyt...@lonely-star.org wrote: Hi, I have a class, where I want to store a callback function as a member to access later: class CallbackClass: def setCallback(self,cb): self.cb = cb def callCallback(self, para):

Re: Storing a callback function as a class member

2010-07-07 Thread Emile van Sebille
On 7/7/2010 2:48 PM Nathan Huesken said... class CallbackClass: def setCallback(self,cb): self.cb = cb def callCallback(self, para): self.cb(para) You'll have to show how you're invoking this -- the following works for me (ie, I don't get an error): class

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Jonathan Hartley
On Jul 7, 8:22 pm, Martin v. Loewis mar...@v.loewis.de wrote: I presume this problem would go away if future versions of Python itself were compiled on Windows with something like MinGW gcc. Also, this would solve the pain of Python developers attempting to redistribute py2exe versions of

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread sturlamolden
On 8 Jul, 00:35, Jonathan Hartley tart...@tartley.com wrote: I see. Thanks very much to both of you for the info, much appreciated. The problem you referred to for py2exe despaired with Python 2.6. For Python 2.5, there was no public download option for msvcr71.dll and msvcp71.dll. There was

Re: Argh! Name collision!

2010-07-07 Thread Rami Chowdhury
On Tuesday 06 July 2010 22:42:25 rantingrick wrote: On Jul 6, 9:11 pm, Alf P. Steinbach /Usenet alf.p.steinbach +use...@gmail.com wrote: pyni! Pronounced like tiny! Yay! hmm, how's about an alternate spelling... pyknee, or pynee, or pynie ... considering those are not taken either?

Re: Python -- floating point arithmetic

2010-07-07 Thread Wolfram Hinderer
On 7 Jul., 19:32, Ethan Furman et...@stoneleaf.us wrote: Nobody wrote: On Wed, 07 Jul 2010 15:08:07 +0200, Thomas Jollans wrote: you should never rely on a floating-point number to have exactly a certain value. Never is an overstatement. There are situations where you can rely upon a

Re: Argh! Name collision!

2010-07-07 Thread MRAB
Rami Chowdhury wrote: On Tuesday 06 July 2010 22:42:25 rantingrick wrote: On Jul 6, 9:11 pm, Alf P. Steinbach /Usenet alf.p.steinbach +use...@gmail.com wrote: pyni! Pronounced like tiny! Yay! hmm, how's about an alternate spelling... pyknee, or pynee, or pynie ... considering those are not

Re: delegation pattern via descriptor

2010-07-07 Thread kedra marbun
On Jul 7, 2:46 am, Bruno Desthuilliers bdesth.quelquech...@free.quelquepart.fr wrote: Gregory Ewing a écrit : Bruno Desthuilliers wrote: kedra marbun a écrit : if we limit our discussion to py: why __{get|set|delete}__ don't receive the 'name' 'class' from

Re: Getting pyparsing to backtrack

2010-07-07 Thread Cousin Stanley
I'm working on street address parsing again, and I'm trying to deal with some of the harder cases. For yet another test case my actual address includes ... East South Mountain Avenue Sometimes written as ... E. South Mtn Ave -- Stanley C. Kitching Human Being

Re: Argh! Name collision!

2010-07-07 Thread Alf P. Steinbach /Usenet
* rantingrick, on 07.07.2010 07:42: On Jul 6, 9:11 pm, Alf P. Steinbach /Usenetalf.p.steinbach +use...@gmail.com wrote: pyni! Pronounced like tiny! Yay! hmm, how's about an alternate spelling... pyknee, or pynee, or pynie ... considering those are not taken either? Hm, for pure shock

Re: delegation pattern via descriptor

2010-07-07 Thread kedra marbun
On Jul 6, 12:11 pm, Steven D'Aprano steve-REMOVE- t...@cybersource.com.au wrote: On Mon, 05 Jul 2010 21:12:47 -0700, kedra marbun wrote: On Jul 5, 7:49 am, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: kedra marbun wrote: now, i'm asking another favor, what about the 2nd point in my 1st

Re: Is This Open To SQL Injection?

2010-07-07 Thread Kee Nethery
Yes, you SQL would be trivial to manipulate via SQL injection. Not only do you need to validate each piece of data submitted by a user, you need to escape all the wildcard characters that your database uses. If the text string supplied by a user has quotes or parens or wildcard characters, the

Re: The real problem with Python 3 - no business case for conversion (was I strongly dislike Python 3)

2010-07-07 Thread Brendan Abel
On Jul 7, 3:00 pm, MRAB pyt...@mrabarnett.plus.com wrote: Brendan Abel wrote: One thing that would be very useful is how to maintain something that works on 2.x and 3.x, but not limiting yourself to 2.6. Giving up versions below 2.6 is out of the question for most projects with a

Re: Storing a callback function as a class member

2010-07-07 Thread Ian Kelly
On Wed, Jul 7, 2010 at 3:48 PM, Nathan Huesken pyt...@lonely-star.org wrote: Hi, I have a class, where I want to store a callback function as a member to access later: class CallbackClass:    def setCallback(self,cb):        self.cb = cb    def callCallback(self, para):        

Re: The real problem with Python 3 - no business case for conversion (was I strongly dislike Python 3)

2010-07-07 Thread geremy condra
On Wed, Jul 7, 2010 at 8:26 PM, Brendan Abel 007bren...@gmail.com wrote: On Jul 7, 3:00 pm, MRAB pyt...@mrabarnett.plus.com wrote: Brendan Abel wrote: One thing that would be very useful is how to maintain something that works on 2.x and 3.x, but not limiting yourself to 2.6. Giving up

ANN: ActivePython 2.7.0.1 is now available

2010-07-07 Thread Sridhar Ratnakumar
We are pleased to announce the availability of ActivePython 2.7.0.1. http://www.activestate.com/activepython This release corresponds to the recently released Python 2.7, and, like ActivePython 2.6, includes the Python Package Manager (PyPM) with essential packages such as Distribute (a

Re: The real problem with Python 3 - no business case for conversion

2010-07-07 Thread Ben Finney
geremy condra debat...@gmail.com writes: On Wed, Jul 7, 2010 at 8:26 PM, Brendan Abel 007bren...@gmail.com wrote: Python 3.x will continue to change.  The incompatibilities between 3.x and 2.x will only become more numerous.  If your goal is to support 2.x, and 3.x, you'd be best

Re: The real problem with Python 3 - no business case for conversion (was I strongly dislike Python 3)

2010-07-07 Thread MRAB
geremy condra wrote: On Wed, Jul 7, 2010 at 8:26 PM, Brendan Abel 007bren...@gmail.com wrote: On Jul 7, 3:00 pm, MRAB pyt...@mrabarnett.plus.com wrote: Brendan Abel wrote: One thing that would be very useful is how to maintain something that works on 2.x and 3.x, but not limiting yourself to

Re: The real problem with Python 3 - no business case for conversion (was I strongly dislike Python 3)

2010-07-07 Thread Fuzzyman
On Jul 5, 1:34 am, sturlamolden sturlamol...@yahoo.no wrote: On 5 Jul, 01:58, John Nagle na...@animats.com wrote:      Exactly.      The incompatible with all extension modules I need part is the problem right now.  A good first step would be to identify the top 5 or 10 modules that are

Re: The real problem with Python 3 - no business case for conversion (was I strongly dislike Python 3)

2010-07-07 Thread Carl Banks
On Jul 7, 2:10 pm, Brendan Abel 007bren...@gmail.com wrote: One thing that would be very useful is how to maintain something that works on 2.x and 3.x, but not limiting yourself to 2.6. Giving up versions below 2.6 is out of the question for most projects with a significant

  1   2   3   >