doctest fails to see tests in decorated functions

2009-02-13 Thread Steven D'Aprano
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. I have a test script on the page demonstrating the problem. Can anyone give me some clues as to a work

data structure for ASTs in Python-written parsers

2009-02-13 Thread eliben
Hello, The Python interpreter uses ASDL (http://www.cs.princeton.edu/~danwang/ Papers/dsl97/dsl97.html) to describe the AST resulting from parsing. In previous versions, there was another AST being used by the compiler module - ast.txt and astgen.py in tools/compiler in the Python 2.5 source. Howe

Re: Untangling pythonWin and IDLE Processes on XP Pro

2009-02-13 Thread Marc 'BlackJack' Rintsch
On Fri, 13 Feb 2009 20:58:33 -0800, W. eWatson wrote: > 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 wh

Re: String concatenation performance with +=

2009-02-13 Thread Steven D'Aprano
Sammo wrote: > Okay, this is what I have tried for string concatenation: > > 1. Using += implemented using simple operations (12 ms) > 2. Using += implemented inside a class (4000+ ms) > 3. Using "".join implemented using simple operations (4000+ ms) > 4. Using "".join implemented inside a class

Re: String concatenation performance with +=

2009-02-13 Thread Steven D'Aprano
Steven D'Aprano wrote: > Benjamin Peterson 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

Re: Avoiding argument checking in recursive calls

2009-02-13 Thread Steven D'Aprano
Terry Reedy wrote: > Steven D'Aprano wrote: >> On Wed, 11 Feb 2009 04:31:10 -0500, Terry Reedy wrote: >> Steven D'Aprano writes: > def fact(n): > if n < 0: raise ValueError > if n = 0: return 1 > return fact(n-1)*n > > At the risk of premature optimizatio

Re: String concatenation performance with +=

2009-02-13 Thread Steven D'Aprano
Benjamin Peterson 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 applies to direct object a

Re: String concatenation performance with +=

2009-02-13 Thread Sammo
Okay, this is what I have tried for string concatenation: 1. Using += implemented using simple operations (12 ms) 2. Using += implemented inside a class (4000+ ms) 3. Using "".join implemented using simple operations (4000+ ms) 4. Using "".join implemented inside a class (4000+ ms) On Feb 14, 3:1

Re: A little bit else I would like to discuss

2009-02-13 Thread Steven D'Aprano
Damon wrote: > Use Visual Studio to program a .net application using Windows Forms. > Run it in Mono on Windows, or OS X, or Linux. ... > Also, you can quibble whether it's Visual > Studio that tries to address this, or the Mono effort. There's no quibble. It's obviously Mono. How can you possibl

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

2009-02-13 Thread Michele Simionato
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. Here's my try >

Re: Embarrasing questio

2009-02-13 Thread Steven D'Aprano
TechieInsights wrote: > On Feb 12, 9:03 am, Catherine Heathcote > wrote: >> But I just cant find it. How do I do an or, as in c/c++'s ||? Just >> trying to do something simple, the python equivilent of: >> >> if(i % 3 == 0 || i % 5 == 0) >> >> Thanks. > > in 2.5 and above you can do > if any(i%3

Re: Untangling pythonWin and IDLE Processes on XP Pro

2009-02-13 Thread W. eWatson
... How can it? It's not IDLE's problem, it's yours. Finally, we can probably agree that I can continue to use IDLE for editing and syntax checking, but to "guarantee" successful execution of the program, I can just double-click on the py file in my folder. Perhaps there is a better way than

Re: Untangling pythonWin and IDLE Processes on XP Pro

2009-02-13 Thread W. eWatson
Scott David Daniels wrote: W. eWatson wrote: Terry Reedy wrote: W. eWatson wrote: From Diez above. What does *NOT* work is writing a Tkinter-based app in idle, and to run it *FROM INSIDE* idle. Instead, open your explorer and double-click on the pyhton-file your app is in. That's all that t

Re: RELEASED Python 3.0.1

2009-02-13 Thread Benjamin Kaplan
On Fri, Feb 13, 2009 at 9:15 PM, Barry Warsaw wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On behalf of the Python development team, I'm happy to announce the > availability of Python 3.0.1, the first bug fix release of Python 3.0. > Version 3.0.1 fixes dozens of bugs reported si

Re: A little bit else I would like to discuss

2009-02-13 Thread Steven D'Aprano
Martin wrote: > Hi, > > at first I wanted to file this under meta-discussions, but your lost > paragraph got me thinking... > > 2009/2/12 Christian Heimes : >> Nobody is going to stop you from creating a large bundle of useful >> extensions as long as you follow the licenses. In fact lots of peo

Re: String concatenation performance with +=

2009-02-13 Thread Benjamin Peterson
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. > > Note that I need to do something to mydata INSIDE the loop, so please > don't tell me to append moredata to a

String concatenation performance with +=

2009-02-13 Thread Sammo
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 = time.time() mydata = "" moredata = "A"

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

2009-02-13 Thread Chris Rebert
On Fri, Feb 13, 2009 at 5:35 PM, wrote: > 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 fu

Re: pdb in 3.0 very buggy (Win XP Home)

2009-02-13 Thread Benjamin Peterson
Aaron Brady gmail.com> writes: > > Hi, got a freeze when running 'pdb' in 3.0. This is a known issue because of the rewrite of the IO library in 3.0. It will hopefully be fixed in 3.1. See http://bugs.python.org/issue3618 for more information. -- http://mail.python.org/mailman/listinfo/pyt

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

2009-02-13 Thread Daniel Fetchinson
> 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 would > you rather de

RELEASED Python 3.0.1

2009-02-13 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On behalf of the Python development team, I'm happy to announce the availability of Python 3.0.1, the first bug fix release of Python 3.0. Version 3.0.1 fixes dozens of bugs reported since the release of Python 3.0 on December 3rd, 2008. Pyth

ANNOUNCING allmydata.org "Tahoe", the Least-Authority Filesystem, v1.3

2009-02-13 Thread zooko
Folks: This "Cloud Storage" system is written entirely in Python except for the CPU-intensive parts (cryptography and erasure coding), which are provided as Python extension modules. Thanks for making Python such a high-quality and effective tool! Regards, Zooko ANNOUNCING allmydata.or

Easier to wrap C or C++ libraries?

2009-02-13 Thread argo785
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 would you rather deal with fr

Re: A little bit else I would like to discuss

2009-02-13 Thread Benjamin Kaplan
On Fri, Feb 13, 2009 at 7:22 PM, Basilisk96 wrote: > On Feb 12, 10:39 pm, Damon wrote: > > * Like R, every time there is a new version of Python, the repository > > should rebuild the packages, for all supported platforms, and make > > available all those that compile cleanly. R also forces you

Re: Levenshtein word comparison -performance issue

2009-02-13 Thread Basilisk96
On Feb 13, 5:42 am, "Gabriel Genellina" wrote: > You may replace the last steps (sort + slice top 5) by heapq.nlargest - at   > least you won't waste time sorting 49995 irrelevant words... > Anyway you should measure the time taken by the first part (Levenshtein),   > it may be the most demanding.

Re: Which to install on my windows vista laptop?

2009-02-13 Thread Kurioz
If you are using 32bit OS(which you are) then use the x86 MSI installer. AMD64 MSI installer is used only when you are using 64bit OS. "Sue" wrote in message news:mailman.9515.1234572128.3487.python-l...@python.org... Hi, Which python 2.6.1 file should I download for my windows vista home prem

Re: how can this iterator be optimized?

2009-02-13 Thread Basilisk96
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 them. 2.) I also read now and then that simple list compre

Which to install on my windows vista laptop?

2009-02-13 Thread Sue
Hi, Which python 2.6.1 file should I download for my windows vista home premium laptop? (32bit, AMD turion 64 x2) the windows x86 MSI installer or the windows AMD64 MSI installer? Thank you! Sue -- http://mail.python.org/mailman/listinfo/python-list

Re: A little bit else I would like to discuss

2009-02-13 Thread Basilisk96
On Feb 12, 10:39 pm, Damon wrote: > * Like R, every time there is a new version of Python, the repository > should rebuild the packages, for all supported platforms, and make > available all those that compile cleanly. R also forces you to write > properly structured documentation for every expose

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

2009-02-13 Thread Gustavo Narea
Hello, everybody. I have this signature-changing decorator which I want to turn into a signature-preserving one. Here's my try , but I get this error: http://paste

Re: A little bit else I would like to discuss

2009-02-13 Thread Simon Hibbs
On 13 Feb, 02:53, azrael wrote: > All I hear when I talk to people who own or eork in SW companies is > "Python? Isn't that that small scripting language. This will never > bring a real application." I am tired of hearing this. Even Microsoft > implemented Python. Only because the GUI building I

Re: Untangling pythonWin and IDLE Processes on XP Pro

2009-02-13 Thread Rhodri James
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 stepped on an invisible banana peel. I think it's evident that I'm not

Re: *nix tail -f multiple log files with Thread

2009-02-13 Thread Jarkko Torppa
On 2009-02-13, Christian Heimes wrote: > David schrieb: >> Hi everyone, >> >> I copied a program from C to track multiple log files. I would like to >> be able to print a label when a log file is updated. Here is the program; > > Don't use threads for the job. On Unix the preferred way is select(

Re: Upgrading standard library module

2009-02-13 Thread Bryan
On Feb 13, 1:52 pm, Jason Scheirer wrote: > On Feb 13, 12:42 pm, Bryan wrote: > > > I have a Python v2.5.2 server running and I found some undesirable > > behavior in the xmlrpclib module that is included with that version of > > Python.  The xmlrpclib version that is included with Python 2.6 > >

Re: Upgrading standard library module

2009-02-13 Thread Jason Scheirer
On Feb 13, 12:42 pm, Bryan wrote: > I have a Python v2.5.2 server running and I found some undesirable > behavior in the xmlrpclib module that is included with that version of > Python.  The xmlrpclib version that is included with Python 2.6 > changes the behavior for the better.  I nervous about

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

2009-02-13 Thread Robert Kern
On 2009-02-13 11:59, tripp wrote: Hello Folks, I have a fortran program I use to process several satellite images. I currently output the results to a text file (~750 mb) which is then read by a perl program that outputs a GIS-ready image using GDAL (www.gdal.org). There are python libraries

Re: Upgrading standard library module

2009-02-13 Thread Mike Driscoll
On Feb 13, 2:42 pm, Bryan wrote: > I have a Python v2.5.2 server running and I found some undesirable > behavior in the xmlrpclib module that is included with that version of > Python.  The xmlrpclib version that is included with Python 2.6 > changes the behavior for the better.  I nervous about u

pdb in 3.0 very buggy (Win XP Home)

2009-02-13 Thread Aaron Brady
Hi, got a freeze when running 'pdb' in 3.0. The program executes correctly with the command 'c', but freezes part way through when running successive 'n' commands. Platform Windows XP Home. Python 3.0 (r30:67507, Dec 3 2008, 20:14:27) [MSC v.1500 32 bit (Intel)] on win32. The 'list' command wa

Upgrading standard library module

2009-02-13 Thread Bryan
I have a Python v2.5.2 server running and I found some undesirable behavior in the xmlrpclib module that is included with that version of Python. The xmlrpclib version that is included with Python 2.6 changes the behavior for the better. I nervous about upgrading my Python install to 2.6 on this

Re: Untangling pythonWin and IDLE Processes on XP Pro

2009-02-13 Thread Scott David Daniels
W. eWatson wrote: Terry Reedy wrote: W. eWatson wrote: From Diez above. What does *NOT* work is writing a Tkinter-based app in idle, and to run it *FROM INSIDE* idle. Instead, open your explorer and double-click on the pyhton-file your app is in. That's all that there is to it. So this is t

Re: problems opening files

2009-02-13 Thread MRAB
mike wrote: I have aprogram that manipulates several text files, does some math and saves new files then exits. The program worked fine on the original set of data, but with new data does not open the files as needed. When I copy and paste the 'open line' from the module to IDLE the file opens.

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

2009-02-13 Thread tripp
On Feb 13, 1:27 pm, MRAB wrote: > tripp wrote: > > Hello Folks, > > > I have a fortran program I use to process several satellite images.  I > > currently output the results to a text file (~750 mb) which is then > > read by a perl program that outputs a GIS-ready image using GDAL > > (www.gdal.or

problems opening files

2009-02-13 Thread mike
I have aprogram that manipulates several text files, does some math and saves new files then exits. The program worked fine on the original set of data, but with new data does not open the files as needed. When I copy and paste the 'open line' from the module to IDLE the file opens. section of c

Re: *nix tail -f multiple log files with Thread

2009-02-13 Thread David
Joe Riopel wrote: On Fri, Feb 13, 2009 at 12:03 PM, David wrote: Hi everyone, I copied a program from C to track multiple log files. I would like to be able to print a label when a log file is updated. Here is the program; Since you're calling tail itself, why not just use tail's ability to

Re: *nix tail -f multiple log files with Thread

2009-02-13 Thread Joe Riopel
On Fri, Feb 13, 2009 at 12:03 PM, David wrote: > Hi everyone, > > I copied a program from C to track multiple log files. I would like to be > able to print a label when a log file is updated. Here is the program; Since you're calling tail itself, why not just use tail's ability to tail multiple f

Re: *nix tail -f multiple log files with Thread

2009-02-13 Thread Christian Heimes
David schrieb: > Hi everyone, > > I copied a program from C to track multiple log files. I would like to > be able to print a label when a log file is updated. Here is the program; Don't use threads for the job. On Unix the preferred way is select()'ing or poll()'ing multiple file descriptors. C

Re: Python knapsack problem

2009-02-13 Thread Terry Reedy
Kurioz wrote: I got the assignment to solve the knapsack problem in Python. I have to find the solution to put items in a sack (I have only one item A, B and C) which maxWeight can't be larger than 6 kilograms. Solution of this problem should be A and C but the only solution I'm getting is B

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

2009-02-13 Thread MRAB
tripp wrote: Hello Folks, I have a fortran program I use to process several satellite images. I currently output the results to a text file (~750 mb) which is then read by a perl program that outputs a GIS-ready image using GDAL (www.gdal.org). There are python libraries for GDAL too. I'd li

Re: Levenshtein word comparison -performance issue

2009-02-13 Thread Terry Reedy
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(searchword): disdi

Re: Python knapsack problem

2009-02-13 Thread Matimus
On Feb 13, 8:06 am, "Kurioz" wrote: > Hi, > > I got the assignment to solve the knapsack problem in Python. I have to find > the solution to put items in a sack (I have only one item A, B and C) which > maxWeight can't be larger than 6 kilograms.  Solution of this problem should > be A and C but t

Re: something wrong with isinstance

2009-02-13 Thread Terry Reedy
Gabriel Genellina wrote: En Fri, 13 Feb 2009 08:43:03 -0200, Peter Otten <__pete...@web.de> escribió: class Type(type): ... def __instancecheck__(self, other): return True ... class A(metaclass=Type): pass ... class B: pass ... isinstance(B(), A) True See also http://www.python.or

Re: best set of modules for web automation without javascript

2009-02-13 Thread Matias Surdi
You should give a look to Selenium. It's great. http://www.openqa.org News123 wrote: Hi, I'd like to do some web automation with python 2.5 - https: - a cookiejar - some forms to be filled in what is the best set of modules. As far as I understood, there is httplib, but it seems (if I un

Fortran array in python (f2py?)...

2009-02-13 Thread tripp
Hello Folks, I have a fortran program I use to process several satellite images. I currently output the results to a text file (~750 mb) which is then read by a perl program that outputs a GIS-ready image using GDAL (www.gdal.org). There are python libraries for GDAL too. I'd like to pipe the

Re: best set of modules for web automation without javascript

2009-02-13 Thread News123
Hi Marco / Paul, Thanks I'll look into mechanize,ClientForm and BeautifulSoup. All three are now installed. I'll just have to play with them. bye N News123 wrote: > Hi Joel, > > Thanks, > This (the urllib2 methods you combined with cookielib) is what I am > currently trying to do. > > I

Re: best set of modules for web automation without javascript

2009-02-13 Thread Paul Rubin
News123 writes: > I would just like to retrieve all the field names and default values of > a form. (Some forms are huge) and wondered thus whether there's already > a python module parsing a html documents for forms , form fields and > field vaules, returning an objcet. that could be modified and

*nix tail -f multiple log files with Thread

2009-02-13 Thread David
Hi everyone, I copied a program from C to track multiple log files. I would like to be able to print a label when a log file is updated. Here is the program; #!/usr/bin/python from threading import Thread import subprocess from Queue import Queue num_threads = 3 queue = Queue() logfiles = ["

Re: Escaping my own chroot...

2009-02-13 Thread Nick Craig-Wood
Jean-Paul Calderone wrote: > On Wed, 11 Feb 2009 09:31:56 -0600, Nick Craig-Wood > wrote: > >r0g wrote: > >> I'm writing a linux remastering script in python where I need to chroot > >> into a folder, run some system commands and then come out and do some > >> tidying up, un-mounting proc &

Python knapsack problem

2009-02-13 Thread Kurioz
Hi, I got the assignment to solve the knapsack problem in Python. I have to find the solution to put items in a sack (I have only one item A, B and C) which maxWeight can't be larger than 6 kilograms. Solution of this problem should be A and C but the only solution I'm getting is B and C whic

Re: sgmllib parser keeps old tag data?

2009-02-13 Thread andrew cooke
Sorry, this reply was delayed (trying to use usenet...) and so now seems (even more) bad tempered than needed. Andrew andrew cooke wrote: > you are declaring class variables, not instance variables. you need to > declare these in an __init__ method. RTFM. > http://docs.python.org/tutorial/clas

Developer needed for Open Source Django/Pinax on-line community

2009-02-13 Thread synarcane
The Hub is a global community of innovators from every profession, background and culture working at 'new frontiers' to tackle the world's most pressing social, cultural and environmental challenges. The Hub has over 1000 members hotdesking in stunning spaces around the world. The Hub aims to give

Re: sgmllib parser keeps old tag data?

2009-02-13 Thread andrew cooke
you are declaring class variables, not instance variables. you need to declare these in an __init__ method. RTFM. http://docs.python.org/tutorial/classes.html#a-first-look-at-classes Berend van Berkum wrote: > class MyParser(sgmllib.SGMLParser): > > content = '' > markup = [] > span_stack = [

Re: sgmllib parser keeps old tag data?

2009-02-13 Thread MRAB
Berend van Berkum wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Fri, Feb 13, 2009 at 02:31:40PM +, MRAB wrote: Berend van Berkum wrote: import sgmllib class MyParser(sgmllib.SGMLParser): content = '' markup = [] span_stack = [] These are i

Re: is there a project running (GUI Builder for Python ) ?

2009-02-13 Thread J Kenneth King
gc_ott...@yahoo.ca writes: > ..I come from Delphi, and compared to Delphi, even Visual Studio >> vanishes ;-) > ...I don't even notice the difference between Delphi (which > I'm still using) >> and wxPython. >> >> I think this story happened to other people to, >> so instead of putting

Re: [ANN] TracShell 0.1 released

2009-02-13 Thread J Kenneth King
J Kenneth King writes: > I tend to work a lot with Trac for project management and have always > found the browser interface to be a productivity killer. I always > wanted a simple command-line interface to Trac, but having never found > one I found a little free time and got off my laurels to ma

Re: best set of modules for web automation without javascript

2009-02-13 Thread Marco Mariani
News123 wrote: I would just like to retrieve all the field names and default values of a form. (Some forms are huge) and wondered thus whether there's already a python module parsing a html documents for forms , form fields and field vaules, returning an objcet. that could be modified and posted

Re: best set of modules for web automation without javascript

2009-02-13 Thread News123
Hi Joel, Thanks, This (the urllib2 methods you combined with cookielib) is what I am currently trying to do. I would just like to retrieve all the field names and default values of a form. (Some forms are huge) and wondered thus whether there's already a python module parsing a html documents fo

Re: Invoking CutePDF from within Python

2009-02-13 Thread python
Tim, > http://pastebin.com/m461bf8f2 Wonderful! That's enough to get me started. Thank you very much. Cheers, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: sgmllib parser keeps old tag data?

2009-02-13 Thread Berend van Berkum
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Fri, Feb 13, 2009 at 02:31:40PM +, MRAB wrote: > Berend van Berkum wrote: > > > >import sgmllib > > > > > >class MyParser(sgmllib.SGMLParser): > > > > content = '' > > markup = [] > > span_stack = [] > > > These are in th

ANN: Supy 1.1

2009-02-13 Thread Greg Ewing
SuPy 1.1 Available -- http://www.cosc.canterbury.ac.nz/greg.ewing/SuPy/ Changes in this version: - Added explicit ways of calling method names ending in '?' or '!'. Python method names 'is_xxx' and 'xxx_ip' map to Ruby 'xxx?' and 'xxx!' respectively. The plain name 'xxx' can

Re: Invoking CutePDF from within Python

2009-02-13 Thread Tim Golden
pyt...@bdurham.com wrote: Tim, FWIW, I usually generate PDFs by printing to a Postscript printer (some random Apple Laserthingy) and then using Ghostscript to do the conversion. I'm happy to post if you're interested. If its not too much bother, I would be interested in learning how you're

Re: Invoking CutePDF from within Python

2009-02-13 Thread python
Tim, > FWIW, I usually generate PDFs by printing to a Postscript printer (some > random Apple Laserthingy) and then using Ghostscript to do the conversion. > I'm happy to post if you're interested. If its not too much bother, I would be interested in learning how you're interfacing to Python to

Re: sgmllib parser keeps old tag data?

2009-02-13 Thread MRAB
Berend van Berkum wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi everyone, I read the source, made numerous tests, but SGMLParser's keeps returning *tag* data from previous parser instances. I'm totally confused why.. The content data it returns is ok. E.g.:: sp = MyParser()

Re: best set of modules for web automation without javascript

2009-02-13 Thread Joe Riopel
On Fri, Feb 13, 2009 at 9:04 AM, News123 wrote: > Hi, > I'd like to do some web automation with python 2.5 > - https: > - a cookiejar > - some forms to be filled in > what is the best set of modules. I have automated some testing of our product, using it's web UI with Python with urllib2 and urrl

sgmllib parser keeps old tag data?

2009-02-13 Thread Berend van Berkum
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi everyone, I read the source, made numerous tests, but SGMLParser's keeps returning *tag* data from previous parser instances. I'm totally confused why.. The content data it returns is ok. E.g.:: sp = MyParser() sp.feed('Test') prin

best set of modules for web automation without javascript

2009-02-13 Thread News123
Hi, I'd like to do some web automation with python 2.5 - https: - a cookiejar - some forms to be filled in what is the best set of modules. As far as I understood, there is httplib, but it seems (if I understood well) to be incoompatible with cookielib I'm a newcomer to webautomation with pyt

Re: An executable operational semantics for Python

2009-02-13 Thread gideon
On Feb 12, 5:14 pm, bearophileh...@lycos.com wrote: > gideon: > > > I've recently finished my Master's thesis on the semantics of Python. > > In my thesis I define the semantics of Python by rewriting an abstract > > machine. The sources that are used to produce my thesis can also be > > compiled i

Re: NNTPlib encoding issue

2009-02-13 Thread MRAB
mohit_ranka wrote: I am getting unknown encoding like, "=?Utf-8?B?QWRyaWFu?= " (quotes for clarity) for name of the author from nntplib module. which seems like an encoding issue with NNTPLib module. What should i do to get author name information in human readable format. The original text wa

Re: A little bit else I would like to discuss

2009-02-13 Thread Martin
2009/2/12 Christian Heimes : > Martin wrote: > [typos igored as requested ;)] > >> How does "small and agile" work with "batteries included"? > > The Python slogan says "batteries included", not "fusion reactor included". I'd be fine with a fusion reactor, my objections would be if skynet was incl

Re: Change in cgi module's handling of POST requests

2009-02-13 Thread Paul Boddie
On 13 Feb, 11:58, "Gabriel Genellina" wrote: > > I noticed this change in behaviour too, and indeed, it is due to   > http://bugs.python.org/issue1817 > But I could not find any RFC/standard/reccomendation/whatever that clearly   > states *what* should happen with a POST request directed to an URI

Re: get wget log message

2009-02-13 Thread JuergenRiemer
> itself but the wget verbose output (log message) e.g. download speed, > total size, etc. ahh I got it 1 minute after sending this post g commands.getstatusoutput(cmd) Juergen -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem building Python extension

2009-02-13 Thread Giampaolo Rodola'
On Feb 13, 10:53 am, David Cournapeau wrote: > On Fri, Feb 13, 2009 at 6:30 PM,   wrote: > > Hi all, > > > I'm trying to build my first python extensionon a win32 system. I > > followed the description > > inhttp://starship.python.net/crew/mwh/toext/your-first-extension.html, > > but after runnin

get wget log message

2009-02-13 Thread JuergenRiemer
Hi, I didn't succeed to do the following: I download a PDF file via wget yet I am not interested in the file itself but the wget verbose output (log message) e.g. download speed, total size, etc. I know I could use < -o log.txt > and then read from that file yet this seems not very elegant. I am n

Re: Problem building Python extension

2009-02-13 Thread Christian Heimes
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... > > Did I something wrong? Yeah, you installed the C# env

Re: Break large file down into multiple files

2009-02-13 Thread Chris
On Feb 13, 1:19 pm, Chris wrote: > On Feb 13, 10:02 am, redbaron wrote: > > > > > > New to python I have a large file that I need to break up into > > > multiple smaller files. I need to break the large file into sections > > > where there are 65535 lines and then write those sections to sepe

Re: Break large file down into multiple files

2009-02-13 Thread Tim Chase
New to python I have a large file that I need to break up into multiple smaller files. I need to break the large file into sections where there are 65535 lines and then write those sections to seperate files. I am familiar with opening and writing files, however, I am struggling with creating

Re: Break large file down into multiple files

2009-02-13 Thread Chris
On Feb 13, 10:02 am, redbaron wrote: > > New to python I have a large file that I need to break up into > > multiple smaller files. I need to break the large file into sections > > where there are 65535 lines and then write those sections to seperate > > files. > > If your lines are variable-l

Re: Invoking CutePDF from within Python

2009-02-13 Thread cm
Hi John, All I need is to say "Print this to CUTEPDF and store as xyz.pdf". I can't answer you question but let me make a suggestion: Try PdfCreator. It lets you control all the process using an activex control. It has events to tell you when the jobs has finish, or report you of eventual erro

Re: Problem building Python extension

2009-02-13 Thread David Cournapeau
On Fri, Feb 13, 2009 at 7:58 PM, wrote: > On 13 feb, 10:53, David Cournapeau wrote: >> On Fri, Feb 13, 2009 at 6:30 PM, wrote: >> > Hi all, >> >> > I'm trying to build my first python extensionon a win32 system. I >> > followed the description >> > inhttp://starship.python.net/crew/mwh/toext/

Re: Untangling pythonWin and IDLE Processes on XP Pro

2009-02-13 Thread W. eWatson
Terry Reedy wrote: W. eWatson wrote: From Diez above. What does *NOT* work is writing a Tkinter-based app in idle, and to run it *FROM INSIDE* idle. Instead, open your explorer and double-click on the pyhton-file your app is in. That's all that there is to it. So this is the absolute truth?

Re: Problem building Python extension

2009-02-13 Thread martijnsteenwijk
On 13 feb, 10:53, David Cournapeau wrote: > On Fri, Feb 13, 2009 at 6:30 PM,   wrote: > > Hi all, > > > I'm trying to build my first python extensionon a win32 system. I > > followed the description > > inhttp://starship.python.net/crew/mwh/toext/your-first-extension.html, > > but after running >

Re: something wrong with isinstance

2009-02-13 Thread Gabriel Genellina
En Fri, 13 Feb 2009 08:43:03 -0200, Peter Otten <__pete...@web.de> escribió: Gabriel Genellina wrote: En Fri, 13 Feb 2009 08:07:58 -0200, Carl Banks escribió: But that brings up another very slight possibility, though not a very likely one in this case: the behavior of isinstance can be cus

Re: Change in cgi module's handling of POST requests

2009-02-13 Thread Gabriel Genellina
En Fri, 13 Feb 2009 02:43:48 -0200, Bob Kline escribió: Joshua Kugler wrote: We just upgraded Python to 2.6 on some of our servers and a number of our CGI scripts broke because the cgi module has changed the way it handles POST requests. When the 'action' attribute was not present in the

Re: something wrong with isinstance

2009-02-13 Thread Peter Otten
Gabriel Genellina wrote: > En Fri, 13 Feb 2009 08:07:58 -0200, Carl Banks > escribió: > >> Well, the OP said he was using Python 3.0, where all classes are new- >> style classes. >> >> But that brings up another very slight possibility, though not a very >> likely one in this case: the behavior

Re: Levenshtein word comparison -performance issue

2009-02-13 Thread Gabriel Genellina
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(searchword): disdict={} for word in sel

Re: thread. question

2009-02-13 Thread Carl Banks
On Feb 9, 7:34 am, Tim Wintle wrote: > Thanks for both replies, > > On Mon, 2009-02-09 at 15:59 +0100, Christian Heimes wrote: > > You shouldn't use the thread module directly. It's not meant to be used > > by a user. Please stick to the threading module. You won't notice a > > slowdown, trust me

Re: something wrong with isinstance

2009-02-13 Thread Gabriel Genellina
En Fri, 13 Feb 2009 08:07:58 -0200, Carl Banks escribió: Well, the OP said he was using Python 3.0, where all classes are new- style classes. But that brings up another very slight possibility, though not a very likely one in this case: the behavior of isinstance can be customized. It can h

Re: Break large file down into multiple files

2009-02-13 Thread Gabriel Genellina
En Fri, 13 Feb 2009 05:43:02 -0200, brianrpsgt1 escribió: On Feb 12, 11:02 pm, "Gabriel Genellina" wrote: En Fri, 13 Feb 2009 04:44:54 -0200, brianrpsgt1   escribió: > New to python I have a large file that I need to break upinto > multiple smallerfiles. I need to break the large file

Levenshtein word comparison -performance issue

2009-02-13 Thread S.Selvam Siva
Hi all, 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(searchword): disdict={} for word in self.dictionary-words: distance=Levenshte

Re: something wrong with isinstance

2009-02-13 Thread Carl Banks
On Feb 12, 10:49 am, redbaron wrote: > Don't really sure, but try to define your class as new-style one. > Like > class GeoMap(object): >    ... Well, the OP said he was using Python 3.0, where all classes are new- style classes. But that brings up another very slight possibility, though not a v

Re: Problem building Python extension

2009-02-13 Thread David Cournapeau
On Fri, Feb 13, 2009 at 6:30 PM, wrote: > Hi all, > > I'm trying to build my first python extensionon a win32 system. I > followed the description in > http://starship.python.net/crew/mwh/toext/your-first-extension.html, > but after running > > C:\Python26\python first-setup.py build_ext -i > >

  1   2   >