multiprocessing python2.6.1

2009-02-14 Thread km
Dear all, I have a problem with multiprocessing module usage with python2.6.1 Here Pool object is to be instantiated with 50 processes and the method 'run' has to be called with pool object. My actual requirement is to reuse the 50 processes for further processing until 100 items. #

How to peek inside a decorated function

2009-02-14 Thread Steven D'Aprano
Suppose I have a function f() which I know has been decorated, but I don't have access to the original undecorated function any longer: def reverse(func): def f(*args): args = list(args) args.reverse() return func(*args) return f def say(*args): print args rsa

Setuptools & Python 3.0

2009-02-14 Thread Sylvain Rabot
Hi, I would like to know if the official maintainers of setuptools are working on a release for Python 3.0. Regards. -- http://mail.python.org/mailman/listinfo/python-list

Re: "Byte" type?

2009-02-14 Thread Chris Rebert
On Sat, Feb 14, 2009 at 9:56 PM, Lie Ryan wrote: > On Sat, 14 Feb 2009 22:10:41 -0800, John Nagle wrote: > >> >>> xx = b'x' > > Isn't this creating a regular byte? > > Shouldn't creation of bytearray be: > xx = bytearray(b'x') Indeed, and slicing that does give back a single byte (which Pyt

Re: "Byte" type?

2009-02-14 Thread Erik Max Francis
John Nagle wrote: With "bytearray", the element type is considered to be "unsigned byte", or so says PEP 3137: "The element data type is always 'B' (i.e. unsigned byte)." Let's try: Python 2.6.1 (r261:67517, Dec 4 2008, 16:51:00) [MSC v.1500 32 bit (Intel)] on win32 >>> xx = b'x' >>>

Re: "Byte" type?

2009-02-14 Thread Lie Ryan
On Sat, 14 Feb 2009 22:10:41 -0800, John Nagle wrote: > >>> xx = b'x' Isn't this creating a regular byte? Shouldn't creation of bytearray be: >>> xx = bytearray(b'x') -- http://mail.python.org/mailman/listinfo/python-list

"Byte" type?

2009-02-14 Thread John Nagle
With "bytearray", the element type is considered to be "unsigned byte", or so says PEP 3137: "The element data type is always 'B' (i.e. unsigned byte)." Let's try: Python 2.6.1 (r261:67517, Dec 4 2008, 16:51:00) [MSC v.1500 32 bit (Intel)] on win32 >>> xx = b'x' >>> repr(xx) "'x'" >>> repr(

Re: doctest fails to see tests in decorated functions

2009-02-14 Thread Michele Simionato
On Feb 15, 6:31 am, Steven D'Aprano wrote: > Never mind, it was a PEBCAK error. I failed to notice that applying a > decorator to a function shadows the functions docstring. > > Normally I would use functools.wraps, but I am currently limping along on a > Python 2.4 installation here, which doesn'

Re: doctest fails to see tests in decorated functions

2009-02-14 Thread Steven D'Aprano
Steven D'Aprano wrote: > I've just spotted a bug in doctest that it fails to see tests inside > decorated functions. It's been reported before: > > http://bugs.python.org/issue1108 > > but the patch submitted doesn't work for me. Never mind, it was a PEBCAK error. I failed to notice that applyi

Re: Reading a file

2009-02-14 Thread Steven D'Aprano
Philipp Pagel wrote: > zaheer.ag...@gmail.com wrote: >> Hi > >> How do i read a file in Python and search a particular pattern >> like I have a file char.txt which has > >> Mango=sweet >> Sky=blue > >> I want to get the strings sweet and blue,How to do this..? > > If your entire file consist

Re: PySerial "write" should accept "bytearray"

2009-02-14 Thread Grant Edwards
On 2009-02-14, John Nagle wrote: > PySerial, which is basically a binary input/output system, is > still requiring "str" instead of "bytearray", even under Python 2.6. > For "file-like objects", "write" functions are supposed to accept > "bytearray" now, and "read" functions should return a "byte

Re: Can Python serial support run at 45.45 baud?

2009-02-14 Thread Grant Edwards
On 2009-02-14, John Nagle wrote: > Roy Smith wrote: >> In article <49970ce7$0$1665$742ec...@news.sonic.net>, >> John Nagle wrote: >> >>> At the hardware level, there's a clock rate, a counter, and a >>> divisor, so arbitrary baud rates can be set. >> >> Is that really true of modern hardware?

Re: Can Python serial support run at 45.45 baud?

2009-02-14 Thread Grant Edwards
On 2009-02-14, John Nagle wrote: > John Nagle wrote: > >>OK, tried to open the port, using Python 2.6, latest PySerial >> and PyWin32: >> >> ser = serial.Serial(port, baudrate=baud, >> bytesize=serial.FIVEBITS, >> parity=serial.PARITY_NONE, >> stopbits=

Re: String concatenation performance with +=

2009-02-14 Thread Steven D'Aprano
Nick Craig-Wood wrote: > The optimized += depends on their being no other references to the > string.  Strings are immutable in python.  So append must return a new > string.  However the += operation was optimised to do an in-place > append if and only if there are no other references to the stri

Re: Function name limit in Python ?

2009-02-14 Thread Steven D'Aprano
Linuxguy123 wrote: > Excuse my ignorance, but is there a limit to the size of function names > in Python ? > > I named a function getSynclientVersion() and I got an error when I > called it. No no, don't tell us what error you got! I love guessing games. I'm guessing you got either a SyntaxErr

ImportError: dynamic module does not define init function (inittypes)

2009-02-14 Thread konteya joshi
Hi, Iam trying to run a programs which resides insides ..\pythonroot. I see the following error on running the program: 'import site' failed; use -v for traceback Traceback (most recent call last): File "skyline\alpine_kickoff.py", line 6, in ? import re File "C:\Perforce\qa\testware\bui

GetKeyboardLayoutName Win32API

2009-02-14 Thread Tsolakos Stavros
Hi all. I was trying to find a way to read the currently selected input layout from an app written in python. I am aware that if the app were written in C, I would have to call the GetKeyboardLayoutName() function. How can this be done in Python? I want to avoid writing an extension just for this.

Re: Untangling pythonWin and IDLE Processes on XP Pro

2009-02-14 Thread Rhodri James
On Sat, 14 Feb 2009 05:03:13 -, W. eWatson wrote: See my response to Scott. Thanks for your reply. I did. It was fundamentally mistaken in so many respects that I formally give up on you. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/p

Re: Reading a file

2009-02-14 Thread Philipp Pagel
zaheer.ag...@gmail.com wrote: > Hi > How do i read a file in Python and search a particular pattern > like I have a file char.txt which has > Mango=sweet > Sky=blue > I want to get the strings sweet and blue,How to do this..? If your entire file consists of such key=value pairs you may want t

Re: Rapidshare to Megaupload script

2009-02-14 Thread James Matthews
This can be used as a great guide on writing pythonic code. Don't look at the specific code that is being corrected but look at how the improvements are being presented. I would recommend someone who is learning python read this guide. On Sun, Feb 15, 2009 at 12:17 AM, MRAB wrote: > aiwarrior w

Re: Rapidshare to Megaupload script

2009-02-14 Thread MRAB
aiwarrior wrote: I've made this script and would like to have some input and share it with the community. I also have a page with some code i produce on my spare time. http://pneves.net Thanks [snip] def from_rapidshare(url): '''Check if this is a rapidshare link''' return (url.starts

Re: Untangling pythonWin and IDLE Processes on XP Pro

2009-02-14 Thread Thorsten Kampe
* W. eWatson (Fri, 13 Feb 2009 20:58:33 -0800) > Scott David Daniels wrote: > > OK, you are using the oldest and least useful revision control > > system, "rename and remember." I'd suggest you get and use bazaar, > > but you'll just ask for shortcuts on how to use it without > > understanding what

Re: Untangling pythonWin and IDLE Processes on XP Pro

2009-02-14 Thread Thorsten Kampe
* Rhodri James (Fri, 13 Feb 2009 22:57:42 -) > > On Fri, 13 Feb 2009 11:13:38 -, W. eWatson > wrote: > > > OK, enough tinkering with the code and others matters on my end trying > > to find a work around. Somehow after much successful use of IDLE's > > execution facility, I've step

Re: ANN: SuPy - Script Sketchup with Python

2009-02-14 Thread r
Great work Greg, you are a Python zen master! -- http://mail.python.org/mailman/listinfo/python-list

Re: Can Python serial support run at 45.45 baud?

2009-02-14 Thread John Nagle
Roy Smith wrote: In article <49970ce7$0$1665$742ec...@news.sonic.net>, John Nagle wrote: At the hardware level, there's a clock rate, a counter, and a divisor, so arbitrary baud rates can be set. Is that really true of modern hardware? The last time I looked at serial port hardware, UARTs

Re: PySerial "write" should accept "bytearray"

2009-02-14 Thread Tino Wildenhain
John Nagle wrote: PySerial, which is basically a binary input/output system, is still requiring "str" instead of "bytearray", even under Python 2.6. For "file-like objects", "write" functions are supposed to accept "bytearray" now, and "read" functions should return a "bytearray". I'm sure pa

PySerial "write" should accept "bytearray"

2009-02-14 Thread John Nagle
PySerial, which is basically a binary input/output system, is still requiring "str" instead of "bytearray", even under Python 2.6. For "file-like objects", "write" functions are supposed to accept "bytearray" now, and "read" functions should return a "bytearray".

Rapidshare to Megaupload script

2009-02-14 Thread aiwarrior
I've made this script and would like to have some input and share it with the community. I also have a page with some code i produce on my spare time. http://pneves.net Thanks # -*- coding: utf-8 -*- ## I Paulo Neves am the owner of this script and i do not allow the copy or distribution ## of th

Re: Can Python serial support run at 45.45 baud?

2009-02-14 Thread John Nagle
MRAB wrote: John Nagle wrote: [snip] So the correct combination, 5 bits with 1.5 stop bits, isn't supported in Python. 1 stop bit will not physically work on Baudot teletypes; the main camshaft doesn't come around fast enough. (Yes, there's an actual mechanical reason for 1.5 stop bits.) Requ

Re: Fortran array in python (f2py?)...

2009-02-14 Thread Scott David Daniels
tripp wrote: ... dump the arrays to a binary file (much faster than dumping it to a text) > from the fortran program How well does python handle binary files? Maybe I could skit the f2py all together if I can get python to read the fortran binary file... Likely your best plan. Look int

Re: Fortran array in python (f2py?)...

2009-02-14 Thread Kurt Smith
On Sat, Feb 14, 2009 at 2:06 PM, tripp wrote: > OK. It sounds like it would be easiest for me, then, to dump the > arrays to a binary file (much faster than dumping it to a text) from > the fortran program. Then use f2py to load a fortran module to read > it.?. I've done something similar and

Re: Fortran array in python (f2py?)...

2009-02-14 Thread tripp
OK. It sounds like it would be easiest for me, then, to dump the arrays to a binary file (much faster than dumping it to a text) from the fortran program. Then use f2py to load a fortran module to read it.?. How well does python handle binary files? Maybe I could skit the f2py all together if I

Re: Easier to wrap C or C++ libraries?

2009-02-14 Thread Christian Heimes
Hrvoje Niksic schrieb: > "Diez B. Roggisch" writes: > >> The answer is easy: if you use C, you can use ctypes to create a >> wrapper - with pure python, no compilation, no platform issues. > > The last part is not true. ctypes doesn't work on 64-bit > architectures, nor does it work when Python

Re: Easier to wrap C or C++ libraries?

2009-02-14 Thread Hrvoje Niksic
"Diez B. Roggisch" writes: > The answer is easy: if you use C, you can use ctypes to create a > wrapper - with pure python, no compilation, no platform issues. The last part is not true. ctypes doesn't work on 64-bit architectures, nor does it work when Python is built with non-gcc Unix compile

Re: Easier to wrap C or C++ libraries?

2009-02-14 Thread argo785
On Feb 14, 12:14 pm, "Diez B. Roggisch" wrote: > > The answer is easy: if you use C, you can use ctypes to create a wrapper > - with pure python, no compilation, no platform issues. > > Which IMHO makes a strong point for C - if you need OO, it's bolted on > easily using Python itself, by creating

Re: Extract an image from a RTF file

2009-02-14 Thread Curt Hash
On Sat, Feb 14, 2009 at 11:01 AM, Terry Reedy wrote: > > bryan.fodn...@gmail.com wrote: >> >> I have a large amount of RTF files where the only thing in them is an >> image. I would like to extract them an save them as a png. >> Eventually, I would like to also grab some text that is on the image

Re: Can Python serial support run at 45.45 baud?

2009-02-14 Thread Roy Smith
In article <49970ce7$0$1665$742ec...@news.sonic.net>, John Nagle wrote: > At the hardware level, there's a clock rate, a counter, and a divisor, > so arbitrary baud rates can be set. Is that really true of modern hardware? The last time I looked at serial port hardware, UARTs took a base clo

Re: Can Python serial support run at 45.45 baud?

2009-02-14 Thread MRAB
John Nagle wrote: [snip] So the correct combination, 5 bits with 1.5 stop bits, isn't supported in Python. 1 stop bit will not physically work on Baudot teletypes; the main camshaft doesn't come around fast enough. (Yes, there's an actual mechanical reason for 1.5 stop bits.) Requesting 2 stop

Re: Can Python serial support run at 45.45 baud?

2009-02-14 Thread MRAB
John Nagle wrote: John Nagle wrote: OK, tried to open the port, using Python 2.6, latest PySerial and PyWin32: ser = serial.Serial(port, baudrate=baud, bytesize=serial.FIVEBITS, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_TWO) ValueError: Can

Re: Can Python serial support run at 45.45 baud?

2009-02-14 Thread John Nagle
John Nagle wrote: OK, tried to open the port, using Python 2.6, latest PySerial and PyWin32: ser = serial.Serial(port, baudrate=baud, bytesize=serial.FIVEBITS, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_TWO) ValueError: Cannot configure port,

Re: [Python-Dev] RELEASED Python 3.0.1

2009-02-14 Thread Ronald Oussoren
On 14 Feb, 2009, at 9:55, Martin v. Löwis wrote: Any chance of getting a Mac installer for this one? Chances are non-zero, yes. I had hoped to build one last night, but got home way later than I had planned. The installer is building as I type this. Ronald smime.p7s Description: S/M

Re: How to debug deadlock?

2009-02-14 Thread Aahz
In article , Victor Lin wrote: > >I am developing a multi-threading application, I encounter a deadlock. >I use Visual C++ Express 2008 to trace the program. Once the deadlock >occurs, I just pause the program and trace. I found that when deadlock >occurs, there will be two threads called python

Re: Can Python serial support run at 45.45 baud?

2009-02-14 Thread MRAB
John Nagle wrote: Grant Edwards wrote: On 2009-02-14, John Nagle wrote: Can Python's serial port support be made to run at 45.45 baud, the old "60 speed" Teletype machine speed? If your hardware and OS supports it, Python can be made to support it. OK, tried to open the port, using Py

Re: Extract an image from a RTF file

2009-02-14 Thread Terry Reedy
bryan.fodn...@gmail.com wrote: I have a large amount of RTF files where the only thing in them is an image. I would like to extract them an save them as a png. Eventually, I would like to also grab some text that is on the image. I think PIL has something for this. Does anyone have any suggesti

Re: Can Python serial support run at 45.45 baud?

2009-02-14 Thread John Nagle
Grant Edwards wrote: On 2009-02-14, John Nagle wrote: Can Python's serial port support be made to run at 45.45 baud, the old "60 speed" Teletype machine speed? If your hardware and OS supports it, Python can be made to support it. OK, tried to open the port, using Python 2.6, latest Py

Re: Reading a file

2009-02-14 Thread Terry Reedy
zaheer.ag...@gmail.com wrote: Hi How do i read a file in Python and search a particular pattern like I have a file char.txt which has Mango=sweet Sky=blue I want to get the strings sweet and blue,How to do this..? for line in open('char.txt'): if line.find('sweet') != -1 or line.find('bl

Financial Modeling in Python

2009-02-14 Thread Ajith Prasad
http://as.wiley.com/WileyCDA/WileyTitle/productCd-0470987847.html now lists the contents of a new book: Financial Modeling in Python Shayne Fletcher, Christopher Gardner ISBN: 978-0-470-98784-1 Hardcover 280 pages August 2009 Wiley List Price: US $130.00 -- http://mail.python.org/mailman/listinf

Re: Thank you, Tkinter. (easy to use)

2009-02-14 Thread Terry Reedy
DLitgo wrote: Does anyone know of a quick and easy install for > PIL + JPEG for Mac OS X (10.5)? If you don't get an answer, try a thread with the above as the title. There may be a python-mac list somewhere too. -- http://mail.python.org/mailman/listinfo/python-list

Re: Easier to wrap C or C++ libraries?

2009-02-14 Thread Diez B. Roggisch
argo...@gmail.com schrieb: When creating a Python binding to a C or C++ library, which is easier to wrap, the C lib or the C++ one? Given a choice, if you had to choose between using one of two libs, one written in C, the other in C+ + -- both having approximately the same functionality -- which

Re: encrypting lines from file with md5 module doesn't work?

2009-02-14 Thread Canned
Nick Craig-Wood schreef: > Canned wrote: >> I write a small script that read lines from plain text file and encrypt >> each lines using md5 module. I have a small word list that contain 2000+ >> words, 1 word/line. Using the code below, I can save the output to >> another file to use it with j

Extract an image from a RTF file

2009-02-14 Thread bryan.fodn...@gmail.com
I have a large amount of RTF files where the only thing in them is an image. I would like to extract them an save them as a png. Eventually, I would like to also grab some text that is on the image. I think PIL has something for this. Does anyone have any suggestion on how to start this? -- http:

Re: Function name limit in Python ?

2009-02-14 Thread Albert Hopkins
On Sat, 2009-02-14 at 07:45 -0700, Linuxguy123 wrote: > Excuse my ignorance, but is there a limit to the size of function names > in Python ? > > I named a function getSynclientVersion() and I got an error when I > called it. You forgot to paste the error. -- http://mail.python.org/mailman/lis

Re: Can Python serial support run at 45.45 baud?

2009-02-14 Thread MRAB
Grant Edwards wrote: On 2009-02-14, John Nagle wrote: Can Python's serial port support be made to run at 45.45 baud, the old "60 speed" Teletype machine speed? If your hardware and OS supports it, Python can be made to support it. [snip] I had a quick look at the Windows API. The struct m

Re: confusion about variable scope in a class

2009-02-14 Thread Diez B. Roggisch
gyro schrieb: Hi, I was writing a Python script to perform some data analyses and was surprised by some behavior I noted. A simple test program illustrating the behavior is below. I do not understand why the value of 'data' is being modified. I am obviously missing something obvious, and would ce

Re: encrypting lines from file with md5 module doesn't work?

2009-02-14 Thread Canned
MRAB schreef: > Canned wrote: >> Hi, >> I need some help with my script. I hope someone can show me the right >> direction or at least explain to me what did I wrong? >> >> I write a small script that read lines from plain text file and encrypt >> each lines using md5 module. I have a small word li

Re: Can Python serial support run at 45.45 baud?

2009-02-14 Thread Grant Edwards
On 2009-02-14, John Nagle wrote: > Can Python's serial port support be made to run at 45.45 baud, > the old "60 speed" Teletype machine speed? If your hardware and OS supports it, Python can be made to support it. > I've restored a Model 15 teletype from WWII. Fun. I worked with one of those

Re: encrypting lines from file with md5 module doesn't work?

2009-02-14 Thread Nick Craig-Wood
Canned wrote: > I write a small script that read lines from plain text file and encrypt > each lines using md5 module. I have a small word list that contain 2000+ > words, 1 word/line. Using the code below, I can save the output to > another file to use it with john the ripper (http://www.open

Re: String concatenation performance with +=

2009-02-14 Thread Nick Craig-Wood
Sammo wrote: > String concatenation has been optimized since 2.3, so using += should > be fairly fast. > > In my first test, I tried concatentating a 4096 byte string 1000 times > in the following code, and the result was indeed very fast (12.352 ms > on my machine). > > import time > t =

Re: confusion about variable scope in a class

2009-02-14 Thread andrew cooke
it's not a scope issue. you are confusing variables and objects. a variable is a box that can hold an object so x = 2 puts the object '2' in the box 'x'. following that with x = '3' changes the box 'x' to hold the object '3'. but lists are also boxes, different from variables. so x = [1,2,3]

Can Python serial support run at 45.45 baud?

2009-02-14 Thread John Nagle
Can Python's serial port support be made to run at 45.45 baud, the old "60 speed" Teletype machine speed? I've restored a Model 15 teletype from WWII. Works great after cleaning, oiling, and adjustment. There's Perl support for this, and a Perl program ("http://www.buzbee.net/heavymetal";) t

confusion about variable scope in a class

2009-02-14 Thread gyro
Hi, I was writing a Python script to perform some data analyses and was surprised by some behavior I noted. A simple test program illustrating the behavior is below. I do not understand why the value of 'data' is being modified. I am obviously missing something obvious, and would certainly apprecia

Re: how can this iterator be optimized?

2009-02-14 Thread Paul McGuire
On Feb 11, 7:22 pm, Basilisk96 wrote: >... > where "func" is a single-argument function that returns either a > string or None, but is an expensive call. > I am pretty sure that the sorted() construct cannot be improved much > further, but... > ...does anyone have ideas on improving the "rawPairs"

Re: Function name limit in Python ?

2009-02-14 Thread Paul McGuire
On Feb 14, 8:45 am, Linuxguy123 wrote: > Excuse my ignorance, but is there a limit to the size of function names > in Python ? > > I named a function getSynclientVersion() and I got an error when I > called it.  I renamed the same function to getSCVersion() and it called > fine. > > Why ? > Hello

Re: Function name limit in Python ?

2009-02-14 Thread MRAB
Linuxguy123 wrote: Excuse my ignorance, but is there a limit to the size of function names in Python ? I named a function getSynclientVersion() and I got an error when I called it. I renamed the same function to getSCVersion() and it called fine. Why ? Probably a just spelling mistake. Double

Re: how can this iterator be optimized?

2009-02-14 Thread josh logan
On Feb 13, 7:44 pm, Basilisk96 wrote: > On Feb 12, 1:15 am, Steven D'Aprano > > wrote: > > > I usually strive > > > for comprehensions if a for loop can be reduced to such. > > > Any particular reason? > > Only two. > 1.) I was impressed by their clarity and conciseness when I first > discovered

Re: Problem building Python extension

2009-02-14 Thread John Machin
On Feb 14, 7:04 pm, martijnsteenw...@gmail.com wrote: > On 13 feb, 12:45, Christian Heimes wrote: > > > martijnsteenw...@gmail.com wrote: > > > Thanks a lot for your reply. I downloaded & installed Visual C# 2008 > > > express, but unfortunately this doesn't change anything in running the > > > se

Function name limit in Python ?

2009-02-14 Thread Linuxguy123
Excuse my ignorance, but is there a limit to the size of function names in Python ? I named a function getSynclientVersion() and I got an error when I called it. I renamed the same function to getSCVersion() and it called fine. Why ? Thanks -- http://mail.python.org/mailman/listinfo/python-lis

Re: [Python-Dev] RELEASED Python 3.0.1

2009-02-14 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Feb 13, 2009, at 11:46 PM, Benjamin Kaplan wrote: Any chance of getting a Mac installer for this one? I believe Ronald is planning to upload it soon. Barry -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (Darwin) iQCVAwUBSZbWDHEjvBPtnXfVA

Re: Turning a signature-changing decorator into a signature-preserving one

2009-02-14 Thread Michele Simionato
On Feb 14, 1:30 pm, Gustavo Narea wrote: > This is what I get: > """ > (Pdb) func.__name__ > 'greetings' > (Pdb) func.__dict__ > {} > (Pdb) func.__module__ > 'pylonsproject.controllers.root' > """ > > Which seems correct to me. > > By the way, I forgot to mention that what is decorated is an insta

Re: encrypting lines from file with md5 module doesn't work?

2009-02-14 Thread MRAB
Canned wrote: Hi, I need some help with my script. I hope someone can show me the right direction or at least explain to me what did I wrong? I write a small script that read lines from plain text file and encrypt each lines using md5 module. I have a small word list that contain 2000+ words, 1

Re: sgmllib parser keeps old tag data?

2009-02-14 Thread Berend van Berkum
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Fri, Feb 13, 2009 at 03:41:52PM +, MRAB wrote: > Berend van Berkum wrote: > >Yes.. tested that and SGMLParser won't let me override __init__, > >(SGMLParser vars are uninitialized even with sgmllib.SGMLParser(self) > >call). > > OK, so SGMLPa

ANN: SuPy 1.2

2009-02-14 Thread Greg Ewing
SuPy 1.2 Available -- http://www.cosc.canterbury.ac.nz/greg.ewing/SuPy/ Changes in this version: - Ruby object and class wrappers now have __class__ and __bases__ attributes that return the right things. As a consequence, isinstance() and issubclass() also work properly o

Reading a file

2009-02-14 Thread zaheer . agadi
Hi How do i read a file in Python and search a particular pattern like I have a file char.txt which has Mango=sweet Sky=blue I want to get the strings sweet and blue,How to do this..? Thanks -- http://mail.python.org/mailman/listinfo/python-list

encrypting lines from file with md5 module doesn't work?

2009-02-14 Thread Canned
Hi, I need some help with my script. I hope someone can show me the right direction or at least explain to me what did I wrong? I write a small script that read lines from plain text file and encrypt each lines using md5 module. I have a small word list that contain 2000+ words, 1 word/line. Using

Re: Turning a signature-changing decorator into a signature-preserving one

2009-02-14 Thread Gustavo Narea
On Feb 14, 6:38 am, Michele Simionato wrote: > On Feb 14, 12:56 am, Gustavo Narea wrote: > > > > > Hello, everybody. > > > I have this signature-changing decorator > > > > which I > > want to turn into a signature-preserving one.

Re: String concatenation performance with +=

2009-02-14 Thread Sammo
On Feb 14, 5:33 pm, Steven D'Aprano wrote: > > AFAIK, using list mutation and "".join only improves performance if > > the "".join is executed outside of the loop. > > Naturally. If you needlessly join over and over again, instead of delaying > until the end, then you might as well do string conca

Re: String concatenation performance with +=

2009-02-14 Thread Sammo
On Feb 14, 4:47 pm, Steven D'Aprano wrote: > > Sammo gmail.com> writes: > >> String concatenation has been optimized since 2.3, so using += should > >> be fairly fast. > > > This is implementation dependent and shouldn't be relied upon. > > It's also a fairly simple optimization and really only a

Re: Thank you, Tkinter. (easy to use)

2009-02-14 Thread DLitgo
On Feb 12, 12:39 am, r wrote: > Hello, > > Tkinter is a great GUI toolkit, for what it lacks in prettiness it > more than makes up for in simple and quick GUI building. I think this > is the main reason Tkinter continues to be Python's built-in GUI > toolkit. It is a great place to start for those

Re: best set of modules for web automation without javascript

2009-02-14 Thread coldpizza
And btw, Selenium scripts can be exported to Python and run under Selenium Remote Control server. I'd say this is the most flexible and advanced way to do webtesting, since you can have a single script that runs with many browsers (opera, firefox, ie, etc), and on many platforms. And combined wit

Re: best set of modules for web automation without javascript

2009-02-14 Thread coldpizza
You should have a look at twill: http://twill.idyll.org It seems to be no longer maintained, but will probably do most of what you expect. And it is built on top of mechanize. On Feb 13, 4:04 pm, News123 wrote: > Hi, > > I'd like to do some web automation with python 2.5 > - https: > - a coo

Re: codecs.open and buffering modes...

2009-02-14 Thread Sam
Hmmm...no one knows the reason for the discrepancy? Should I post on the developers' list to see if anyone knows? Thanks On Feb 9, 6:19 pm, Sam wrote: > codecs.open defaults to line buffering.  But open defaults to using > the system buffer size.  Why the discrepancy?  Is it different for a > r

Re: Levenshtein word comparison -performance issue

2009-02-14 Thread Peter Otten
Gabriel Genellina wrote: > En Fri, 13 Feb 2009 08:16:00 -0200, S.Selvam Siva > escribió: > >> I need some help. >> I tried to find top n(eg. 5) similar words for a given word, from a >> dictionary of 50,000 words. >> I used python-levenshtein module,and sample code is as follow. >> >> def foo(se

Re: Pickling classes (not class instances)

2009-02-14 Thread Aaron Brady
On Feb 14, 2:19 am, Nicolas M. Thiéry wrote: >          Dear python developers, > > I got no answer to my previous post on this thread "Pickling classes > (not class instances)". > This issue is a show stopper for our project. Any suggestion for where > to ask? snip to http://groups.google.com/gro

Re: [Python-Dev] RELEASED Python 3.0.1

2009-02-14 Thread Martin v. Löwis
> Any chance of getting a Mac installer for this one? Chances are non-zero, yes. Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem building Python extension

2009-02-14 Thread martijnsteenwijk
On 14 feb, 09:04, martijnsteenw...@gmail.com wrote: > On 13 feb, 12:45, Christian Heimes wrote: > > > martijnsteenw...@gmail.com wrote: > > > Thanks a lot for your reply. I downloaded & installed Visual C# 2008 > > > express, but unfortunately this doesn't change anything in running the > > > setu

Re: Pickling classes (not class instances)

2009-02-14 Thread Nicolas M . Thiéry
Dear python developers, I got no answer to my previous post on this thread "Pickling classes (not class instances)". This issue is a show stopper for our project. Any suggestion for where to ask? Thanks in advance! Best regards, Nicolas > Purpose

Re: Problem building Python extension

2009-02-14 Thread martijnsteenwijk
On 13 feb, 12:45, Christian Heimes wrote: > martijnsteenw...@gmail.com wrote: > > Thanks a lot for your reply. I downloaded & installed Visual C# 2008 > > express, but unfortunately this doesn't change anything in running the > > setup file. Unfortunately, still no pyd file is produced... > > > Di