Re: Sieve of Zakiya

2008-11-17 Thread jzakiya
On Nov 4, 4:12 pm, jzakiya <[EMAIL PROTECTED]> wrote: > Update: 2008/11/03 > > Architecture & coding improvements. Renamed generators. > > I am 90% finished writing up a mathematical analysis of my method. > In the process I found an architectural optimization to the sieve > process which is incorp

Re: Official definition of call-by-value (Re: Finding the instancereference...)

2008-11-17 Thread Steven D'Aprano
On Mon, 17 Nov 2008 22:08:04 +0200, Hendrik van Rooyen wrote: > And here one is faced with the same problem as I pointed to above - if > you do not have access to the struct definition (which you don't have at > run time), its kind of difficult to figure out where the value is, and > you can only

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-17 Thread Steven D'Aprano
On Mon, 17 Nov 2008 18:35:04 -0800, Craig Allen wrote: >> >> * Do all objects have values? (Ignore the Python >> >> docs if necessary.) >> >> > If one allows null values, I am current thinking yes. >> >> I don't see a difference between a "null value" and not having a value. >> >> > I think the d

Re: special editor support for indentation needed.

2008-11-17 Thread Andreas Roehler
Eric S. Johansson wrote: > Jeremiah Dodds wrote: > >> Eric, I don't have a good readily available solution to what you're >> trying to do, but it seems to me that it would be worth your time to get >> comfortable with elisp, and how it's used in emacs. The emacs >> documentation is pretty good, ev

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-17 Thread Steven D'Aprano
On Sun, 16 Nov 2008 23:34:58 -0500, Terry Reedy wrote: > Steven D'Aprano wrote: > class EqualsAll(object): >> ... def __eq__(self, other): >> ... return True >> ... > 5 == EqualsAll() >> True >> >> >> The methods of 5 don't even get called. > > Why do you say that? As

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-17 Thread Aaron Brady
On Nov 17, 8:35 pm, Craig Allen <[EMAIL PROTECTED]> wrote: > > >> * Do all objects have values? (Ignore the Python > > >>  docs if necessary.) > > > > If one allows null values, I am current thinking yes. > > > I don't see a difference between a "null value" > > and not having a value. > > I think

Re: Python-URL! - weekly Python news and links (Nov 17)

2008-11-17 Thread Gabriel Genellina
En Mon, 17 Nov 2008 23:53:25 -0200, <[EMAIL PROTECTED]> escribió: On Nov 17, 4:06 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: En Mon, 17 Nov 2008 15:44:23 -0200, <[EMAIL PROTECTED]> escribió: On Nov 17, 8:54 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: Candidate to *Longest and

Re: Design By Contract in Python

2008-11-17 Thread Aaron Brady
On Nov 18, 12:22 am, Ryan Freckleton <[EMAIL PROTECTED]> wrote: > Any and all constructive critiques are be welcome > > Implementation:    http://pastebin.com/f368d5396 > Example class:      http://pastebin.com/f51be54be > > Thanks, > Ryan Freckleton The links produced the following error message:

Re: Avoiding local variable declarations?

2008-11-17 Thread Marc 'BlackJack' Rintsch
On Tue, 18 Nov 2008 00:18:51 +, Steven D'Aprano wrote: > On Mon, 17 Nov 2008 12:32:35 +, Marc 'BlackJack' Rintsch wrote: > >> Not such illogical crap like >> ``a = a + 1`` which must be obviously false unless 1 is defined as the >> neutral element for the definition of ``+`` here. > > I

Re: possible newline problems

2008-11-17 Thread Lawrence D'Oliveiro
Robocop wrote: > for line in fileinput.input(['/proc/mounts']): This will include the newline at the end of every line. > if line == '[EMAIL PROTECTED]:/usr/home/sites/www.website.com/ > web/PICTURES/django /www/htdocs/hatProductAdd/media/images/PICTURES/ > django fuse rw,nosuid,nodev,user

Design By Contract in Python

2008-11-17 Thread Ryan Freckleton
Hi Everyone, I'm currently developing a decorator and metaclass based implementation of design by contract for python. (I'd have uploaded it to PyPI already, but I haven't had time to create a GPG key) and wanted to see if anyone wanted to take a look or interested in trying it out. Basicall

Re: Avoiding local variable declarations?

2008-11-17 Thread Steven D'Aprano
On Mon, 17 Nov 2008 23:12:25 -0200, Gabriel Genellina wrote: > Perhaps you didn't read carefully the above post? Er, yes, you got me on that. :( -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: parsing grub's menu.lst

2008-11-17 Thread CarlFK
On Nov 17, 12:56 pm, Albert Hopkins <[EMAIL PROTECTED]> wrote: > On Mon, 2008-11-17 at 10:27 -0800, CarlFK wrote: > > I need some code that will read in grubs menu.lst file, and give me a > > list of dicts: > > > [{'title':'Ubuntu, kernel 2.6.15-23-686', > > 'root':'(hd0,0)', > > 'kernel':'/boot/vm

Re: Python-URL! - weekly Python news and links (Nov 17)

2008-11-17 Thread rurpy
On Nov 17, 11:10 am, "Francesco Guerrieri" <[EMAIL PROTECTED]> wrote: > On Mon, Nov 17, 2008 at 6:44 PM, <[EMAIL PROTECTED]> wrote: >> On Nov 17, 8:54 am, "Gabriel Genellina" <[EMAIL PROTECTED]> >> wrote: >>> Candidate to *Longest and Most Boring Thread of the Year* - started >>> more than

Re: Installation on Vista (Was: ANN: ActivePython 2.6.0.0 is now available)

2008-11-17 Thread Mensanator
On Nov 17, 7:58 pm, Mensanator <[EMAIL PROTECTED]> wrote: > On Nov 17, 7:24 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > > > > > > > Mensanator wrote: > > > On Nov 17, 6:26 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > > >> Mensanator wrote: > > >>> On Nov 17, 5:44 pm, Steve Holden <[EMAIL PROTECT

Re: python script to act as list server

2008-11-17 Thread Tim Roberts
William Gill <[EMAIL PROTECTED]> wrote: >Before I spend the next couple weeks researching and testing, can anyone >tell me if what I want to do is possible, and possibly point me in the >right direction to get started. > >I want to forward any email addressed to [EMAIL PROTECTED] to a python >s

Re: Midi manipulation

2008-11-17 Thread Tim Roberts
Massi <[EMAIL PROTECTED]> wrote: > >I'm writing a script for didactic musical purpose. As first step I >need something as simple as possible, for example a library of >functions which are able to play a certain note, with a given >instrument and a given length. I thought midi was good for this aim,

Re: Question: what to do, my Python is getting crazy

2008-11-17 Thread Tim Roberts
Pekeika <[EMAIL PROTECTED]> wrote: > >10 minutes later after I said thanks... the message came out again... >this is the complete lines: > >PythonWin 2.5.2 (r252:60911, Mar 27 2008, 17:57:18) [MSC v.1310 32 bit >(Intel)] on win32. >Portions Copyright 1994-2006 Mark Hammond - see 'Help/About PythonW

Re: subprocess with shared environment?

2008-11-17 Thread alex23
On Nov 18, 9:27 am, rowen <[EMAIL PROTECTED]> wrote: > I'd like to replace some shell scripts with Python, but one step of > the script modifies my environment in a way that the subsequent steps > require. > Is there a straightforward  way to do this (without having to resort > to writing some of i

Re: compressed serialization module

2008-11-17 Thread greg
Mark wrote: Thanks guys. This is for serializing to disk. I was hoping to not have to use too many intermediate steps You should be able to use a gzip.GzipFile or bz2.BZ2File and pickle straight into it. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: compressed serialization module

2008-11-17 Thread Mark
On Nov 17, 3:08 pm, [EMAIL PROTECTED] wrote: >     Mark> def saveOjb(self, dataObj): >     Mark>     fName = self.version + '_' + self.modname + '.dat' >     Mark>     f = open(fName, 'w') >     Mark>     dStr = pickle.dumps(dataObj) >     Mark>     c = dStr.encode("bz2") >     Mark>     pickle.dum

Re: Python-URL! - weekly Python news and links (Nov 17)

2008-11-17 Thread rurpy
On Nov 17, 11:17 am, George Sakkis <[EMAIL PROTECTED]> wrote: > On Nov 17, 12:44 pm, [EMAIL PROTECTED] wrote: >> On Nov 17, 8:54 am, "Gabriel Genellina" <[EMAIL PROTECTED]> >> wrote: >> >> > Candidate to *Longest and Most Boring Thread of the Year* - started >> > more than a month ago, curr

Re: end child process when parent dies (on Unix)

2008-11-17 Thread Miles
On Mon, Nov 17, 2008 at 2:51 AM, Дамјан Георгиевски wrote: >>> I'm starting a Unix tool with subprocess.Popen() from a python script >>> and I want the child to be killed when the parent (my script) ends >>> for whatever reason *including* if it gets killed by SIGKILL. >> >> A Linux-specific soluti

Re: Python-URL! - weekly Python news and links (Nov 17)

2008-11-17 Thread Gabriel Genellina
En Mon, 17 Nov 2008 21:21:07 -0200, Joe Strout <[EMAIL PROTECTED]> escribió: On Nov 17, 2008, at 4:06 PM, Gabriel Genellina wrote: I don't feel anybody would improve their Python skills chasing what the "value" of an object is, least to make contortions so some arbitrary definition of "cal

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-17 Thread Craig Allen
> >> * Do all objects have values? (Ignore the Python > >> docs if necessary.) > > > If one allows null values, I am current thinking yes. > > I don't see a difference between a "null value" > and not having a value. > I think the difference is concrete... an uninitialized variable in C has no va

Re: PP3E error

2008-11-17 Thread Gabriel Genellina
[top posting fixed] On Nov 16, 2008, at 10:14 PM, Gabriel Genellina wrote: En Mon, 17 Nov 2008 03:32:35 -0200, ryan payton <[EMAIL PROTECTED]> escribió: I still need help with a PP3E error I am getting in my 'PyEdit' program I have from Progamming Python 3rd Edition. I am working on a m

Re: Installation on Vista (Was: ANN: ActivePython 2.6.0.0 is now available)

2008-11-17 Thread Mensanator
On Nov 17, 7:24 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Mensanator wrote: > > On Nov 17, 6:26 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > >> Mensanator wrote: > >>> On Nov 17, 5:44 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Trent Mick wrote: > > Mensanator wrote: > What

Re: Python-URL! - weekly Python news and links (Nov 17)

2008-11-17 Thread rurpy
On Nov 17, 4:06 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Mon, 17 Nov 2008 15:44:23 -0200, <[EMAIL PROTECTED]> escribió: >> On Nov 17, 8:54 am, "Gabriel Genellina" <[EMAIL PROTECTED]> >> wrote: >>> Candidate to *Longest and Most Boring Thread of the Year* - started >>> more th

Re: Python and Its Libraries--Who's on First?

2008-11-17 Thread W. eWatson
Aahz wrote: In article <[EMAIL PROTECTED]>, W. eWatson <[EMAIL PROTECTED]> wrote: George Sakkis wrote: On Nov 17, 12:25 am, "W. eWatson" <[EMAIL PROTECTED]> wrote: Is there some repository that says something like for Python 2.5 it works with: Win OSes: W2K, XP, Vista numpy vers y, matplotlib

Re: Avoiding local variable declarations?

2008-11-17 Thread Russ P.
On Nov 17, 5:12 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Mon, 17 Nov 2008 22:18:51 -0200, Steven D'Aprano > <[EMAIL PROTECTED]> escribió: > > > On Mon, 17 Nov 2008 12:32:35 +, Marc 'BlackJack' Rintsch wrote: > > >> Not such illogical crap like > >> ``a = a + 1`` which must be obv

Re: Installation on Vista (Was: ANN: ActivePython 2.6.0.0 is now available)

2008-11-17 Thread Steve Holden
Mensanator wrote: > On Nov 17, 6:26 pm, Steve Holden <[EMAIL PROTECTED]> wrote: >> Mensanator wrote: >>> On Nov 17, 5:44 pm, Steve Holden <[EMAIL PROTECTED]> wrote: Trent Mick wrote: > Mensanator wrote: What about Vista? Do you need to use the Administrator account to ins

Re: Does python is suitable for enterprise cluster management?

2008-11-17 Thread Jason Scheirer
On Nov 16, 8:56 am, Asaf Hayman <[EMAIL PROTECTED]> wrote: > Is anyone familiar or aware of a successful enterprise class project > in Python to control and monitor a cluster of computers? > > As a part of a bigger project my company needs to build a cluster > management system. The aim of the syst

Re: Avoiding local variable declarations?

2008-11-17 Thread Gabriel Genellina
En Mon, 17 Nov 2008 22:18:51 -0200, Steven D'Aprano <[EMAIL PROTECTED]> escribió: On Mon, 17 Nov 2008 12:32:35 +, Marc 'BlackJack' Rintsch wrote: Not such illogical crap like ``a = a + 1`` which must be obviously false unless 1 is defined as the neutral element for the definition of ``+`

Re: Customizing sequence types

2008-11-17 Thread Gabriel Genellina
En Mon, 17 Nov 2008 22:04:43 -0200, Mr.SpOOn <[EMAIL PROTECTED]> escribió: On Mon, Nov 17, 2008 at 8:30 PM, Terry Reedy <[EMAIL PROTECTED]> wrote: Sets and dicts use __hash__ and __eq__ together, as documented. "If a class does not define an __eq__() method it should not define a __hash__()

Re: Installation on Vista (Was: ANN: ActivePython 2.6.0.0 is now available)

2008-11-17 Thread Mensanator
On Nov 17, 6:26 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Mensanator wrote: > > On Nov 17, 5:44 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > >> Trent Mick wrote: > >>> Mensanator wrote: > >> What about Vista? Do you need to use the Administrator account to > >> install it? > > My c

Re: subprocess with shared environment?

2008-11-17 Thread Gabriel Genellina
En Mon, 17 Nov 2008 21:27:09 -0200, rowen <[EMAIL PROTECTED]> escribió: I'd like to replace some shell scripts with Python, but one step of the script modifies my environment in a way that the subsequent steps require. A simple translation to a few lines of subprocess.call(...) fails because

Re: regular expressions ... slow

2008-11-17 Thread Gabriel Genellina
En Mon, 17 Nov 2008 19:37:18 -0200, Uwe Schmitt <[EMAIL PROTECTED]> escribió: Is anobody aware of this post: http://swtch.com/~rsc/regexp/regexp1.html ? Are there any plans to speed up Pythons regular expression module ? Or is the example in this artricle too far from reality ??? It's a p

Re: Installation on Vista (Was: ANN: ActivePython 2.6.0.0 is now available)

2008-11-17 Thread Steve Holden
Mensanator wrote: > On Nov 17, 5:44 pm, Steve Holden <[EMAIL PROTECTED]> wrote: >> Trent Mick wrote: >>> Mensanator wrote: >> What about Vista? Do you need to use the Administrator account to >> install it? > My currently understanding is that the ActivePython installer will > promp

Re: Need help in understanding a python code

2008-11-17 Thread Steven D'Aprano
On Sun, 16 Nov 2008 04:34:40 -0800, John Machin wrote: > Nothing to do with style. It was the screaming inefficiency of: >if non_trivial_condition: return x >if not non_trivial_condition: return y > that fired me up. "Screaming inefficiency"? Try "micro-optimization". The difference in e

Re: Avoiding local variable declarations?

2008-11-17 Thread Steven D'Aprano
On Mon, 17 Nov 2008 12:32:35 +, Marc 'BlackJack' Rintsch wrote: > Not such illogical crap like > ``a = a + 1`` which must be obviously false unless 1 is defined as the > neutral element for the definition of ``+`` here. I don't quite know what you mean by "neutral element". I think you mean

Re: Customizing sequence types

2008-11-17 Thread Gabriel Genellina
En Mon, 17 Nov 2008 16:21:39 -0200, Chris Rebert <[EMAIL PROTECTED]> escribió: __cmp__ does rich comparisons and is supposed to return 0 for equality, -1 if the object is less than the other, and 1 if it's greater than the other. So, using == as its definition is broken as it Just a little c

Re: Sorting lists

2008-11-17 Thread Steven D'Aprano
On Mon, 17 Nov 2008 14:36:03 -0500, Terry Reedy wrote: > [EMAIL PROTECTED] wrote: >> Chris Rebert: >>> You use the `key` argument to .sort(): L2.sort(key=lambda item: >>> item[1]) >> >> I like the lambda because it's a very readable solution that doesn't >> require the std lib and it doesn't forc

Re: Installation on Vista (Was: ANN: ActivePython 2.6.0.0 is now available)

2008-11-17 Thread Mensanator
On Nov 17, 5:44 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Trent Mick wrote: > > Mensanator wrote: > What about Vista? Do you need to use the Administrator account to > install it? > >>> My currently understanding is that the ActivePython installer will > >>> prompt for administrator p

Re: Customizing sequence types

2008-11-17 Thread Mr . SpOOn
On Mon, Nov 17, 2008 at 8:30 PM, Terry Reedy <[EMAIL PROTECTED]> wrote: > Sets and dicts use __hash__ and __eq__ together, as documented. > > "If a class does not define an __eq__() method it should not define a > __hash__() operation either;" (3.0 manual, but same earlier). Well, maybe, but in th

Re: Problems Writing £ (pound ste rling) To MS SQL Server using pym ssql

2008-11-17 Thread Gabriel Genellina
En Mon, 17 Nov 2008 15:05:43 -0200, J. Cliff Dyer <[EMAIL PROTECTED]> escribió: On Mon, 2008-11-17 at 15:55 +, Darren Mansell wrote: On Mon, 2008-11-17 at 15:24 +, Tim Golden wrote: > Darren Mansell wrote: > > > > I'm trying to write a £ symbol to an MS SQL server using pymsssql . > >

Re: subprocess with shared environment?

2008-11-17 Thread Albert Hopkins
On Mon, 2008-11-17 at 15:27 -0800, rowen wrote: > I'd like to replace some shell scripts with Python, but one step of > the script modifies my environment in a way that the subsequent steps > require. > > A simple translation to a few lines of subprocess.call(...) fails > because the first call mo

Re: Installation on Vista (Was: ANN: ActivePython 2.6.0.0 is now available)

2008-11-17 Thread Steve Holden
Trent Mick wrote: > Mensanator wrote: What about Vista? Do you need to use the Administrator account to install it? >>> My currently understanding is that the ActivePython installer will >>> prompt for administrator privileges if required. I know that if the >>> current user is a member o

Re: regular expressions ... slow

2008-11-17 Thread MRAB
On Nov 17, 10:24 pm, Terry Reedy <[EMAIL PROTECTED]> wrote: > Jerry Hill wrote: > > On Mon, Nov 17, 2008 at 4:37 PM, Uwe Schmitt > > <[EMAIL PROTECTED]> wrote: > >> Hi, > > >> Is anobody aware of this post:  http://swtch.com/~rsc/regexp/regexp1.html? > > > Yes, it's been brought up here, on python-

Re: segfault matplotlib with Python2.6

2008-11-17 Thread Magdoll
I just compiled all of these from source. I'm installing them on school Linux servers (most of them Fedora or RedHat I think), which means I don't have root permission, so I basically have to install everything under my home directory and hope that nothing conflictsmost things worked up until n

subprocess with shared environment?

2008-11-17 Thread rowen
I'd like to replace some shell scripts with Python, but one step of the script modifies my environment in a way that the subsequent steps require. A simple translation to a few lines of subprocess.call(...) fails because the first call modifies the environment, but the other lines don't see it. I

Re: segfault matplotlib with Python2.6

2008-11-17 Thread Jerry Hill
On Mon, Nov 17, 2008 at 5:58 PM, Magdoll <[EMAIL PROTECTED]> wrote: > Has anyone run into the same problem I have? I used to run matplotlib > with Python2.5 and everything worked fine. Now I use Python2.6, and > everything falls apart. > > I installed numpy, libpng, and freetype as required by matp

Re: Python-URL! - weekly Python news and links (Nov 17)

2008-11-17 Thread Joe Strout
On Nov 17, 2008, at 4:06 PM, Gabriel Genellina wrote: I don't feel anybody would improve their Python skills chasing what the "value" of an object is, least to make contortions so some arbitrary definition of "call by value" be applicable to the language. Actually, contortions are required

Re: compressed serialization module

2008-11-17 Thread skip
Mark> def saveOjb(self, dataObj): Mark> fName = self.version + '_' + self.modname + '.dat' Mark> f = open(fName, 'w') Mark> dStr = pickle.dumps(dataObj) Mark> c = dStr.encode("bz2") Mark> pickle.dump(c, f, pickle.HIGHEST_PROTOCOL) Mark> f.close()

Re: Python-URL! - weekly Python news and links (Nov 17)

2008-11-17 Thread Gabriel Genellina
En Mon, 17 Nov 2008 15:44:23 -0200, <[EMAIL PROTECTED]> escribió: On Nov 17, 8:54 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: Candidate to *Longest and Most Boring Thread of the Year* - started more than a month ago, currently discussing "The official definition of call-by-val

segfault matplotlib with Python2.6

2008-11-17 Thread Magdoll
Has anyone run into the same problem I have? I used to run matplotlib with Python2.5 and everything worked fine. Now I use Python2.6, and everything falls apart. I installed numpy, libpng, and freetype as required by matplotlib, and the installation all went well. But when I try to plot even the s

Re: possible newline problems

2008-11-17 Thread John Machin
On Nov 18, 9:26 am, Robocop <[EMAIL PROTECTED]> wrote: > I'm running some stupid little script that's supposed to alert me if > some fuse link exists.  All i do is read in /proc/mounts and look to > match the fuse mount command in question, i'm doing this: > > output = open("/www/htdocs/hatProductA

Re: Retrieve Custom 404 page.

2008-11-17 Thread godavemon
Perfect! Thanks! On Nov 17, 4:16 pm, Albert Hopkins <[EMAIL PROTECTED]> wrote: > On Mon, 2008-11-17 at 13:59 -0800, godavemon wrote: > > I'm using urllib2 to pull pages for a custom version of a web proxy > > and am having issues with 404 errors.  Urllib2 does a great job of > > letting me know t

possible newline problems

2008-11-17 Thread Robocop
I'm running some stupid little script that's supposed to alert me if some fuse link exists. All i do is read in /proc/mounts and look to match the fuse mount command in question, i'm doing this: output = open("/www/htdocs/hatProductAdd/add/output.txt", "a") for line in fileinput.input(['/proc/m

Re: regular expressions ... slow

2008-11-17 Thread Terry Reedy
Jerry Hill wrote: On Mon, Nov 17, 2008 at 4:37 PM, Uwe Schmitt <[EMAIL PROTECTED]> wrote: Hi, Is anobody aware of this post: http://swtch.com/~rsc/regexp/regexp1.html ? Yes, it's been brought up here, on python-dev and python-ideas several times in the past year and a half. Are there any p

Re: special editor support for indentation needed.

2008-11-17 Thread Eric S. Johansson
John Yeung wrote: > On Nov 15, 8:50 pm, "Eric S. Johansson" <[EMAIL PROTECTED]> wrote: >> well, therein lies the rub. I don't know lisp, >> I don't know Emacs internals let alone python mode. > > Unfortunately, neither do I. Actually, I haven't touched Emacs since > my college days, and barely r

Re: Retrieve Custom 404 page.

2008-11-17 Thread Albert Hopkins
On Mon, 2008-11-17 at 13:59 -0800, godavemon wrote: > I'm using urllib2 to pull pages for a custom version of a web proxy > and am having issues with 404 errors. Urllib2 does a great job of > letting me know that a 404 happened with the following code. > > import urllib2 > url = 'http://cnn.com/a

Re: regular expressions ... slow

2008-11-17 Thread Terry Reedy
Uwe Schmitt wrote: Hi, Is anobody aware of this post: http://swtch.com/~rsc/regexp/regexp1.html ? Near the end: While writing the text editor sam [6] in the early 1980s, Rob Pike wrote a new regular expression implementation, which Dave Presotto extracted into a library that appeared in th

Re: regular expressions ... slow

2008-11-17 Thread Jerry Hill
On Mon, Nov 17, 2008 at 4:37 PM, Uwe Schmitt <[EMAIL PROTECTED]> wrote: > Hi, > > Is anobody aware of this post: http://swtch.com/~rsc/regexp/regexp1.html ? Yes, it's been brought up here, on python-dev and python-ideas several times in the past year and a half. > Are there any plans to speed u

Retrieve Custom 404 page.

2008-11-17 Thread godavemon
I'm using urllib2 to pull pages for a custom version of a web proxy and am having issues with 404 errors. Urllib2 does a great job of letting me know that a 404 happened with the following code. import urllib2 url = 'http://cnn.com/asfsdafsadfasdf/' try: page = urllib2.urlopen( url ) except u

Re: Pythonwin not loading DLL, should I change extensions by .pyo or pyd?

2008-11-17 Thread Gabriel Genellina
En Mon, 17 Nov 2008 13:01:11 -0200, Pekeika <[EMAIL PROTECTED]> escribió: Python 2.5 doesn't support/load .dll anymore. Is PythonWin 2.5 the same case? If a .DLL file is not loading, should I change its extension for it to work? What extensions should be now, .pyo, .pyd, etc? which one? What

regular expressions ... slow

2008-11-17 Thread Uwe Schmitt
Hi, Is anobody aware of this post: http://swtch.com/~rsc/regexp/regexp1.html ? Are there any plans to speed up Pythons regular expression module ? Or is the example in this artricle too far from reality ??? Greetings, Uwe -- http://mail.python.org/mailman/listinfo/python-list

Re: Question: what to do, my Python is getting crazy

2008-11-17 Thread Gabriel Genellina
En Mon, 17 Nov 2008 12:56:07 -0200, Pekeika <[EMAIL PROTECTED]> escribió: 10 minutes later after I said thanks... the message came out again... this is the complete lines: PythonWin 2.5.2 (r252:60911, Mar 27 2008, 17:57:18) [MSC v.1310 32 bit (Intel)] on win32. Portions Copyright 1994-2006 Ma

Re: compressed serialization module

2008-11-17 Thread Mark
Thanks guys. This is for serializing to disk. I was hoping to not have to use too many intermediate steps, but I couldn't figure out how to pickle data into zipfile without using either intermediate string or file. That's cool here's what I'll probably settle on (tested) - now just need to reve

Re: Multiple equates

2008-11-17 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Tim Chase <[EMAIL PROTECTED]> wrote: . . . >To the OP, I think rather than cluttering my code, I'd just >create a loop > > for i in [x1,x2,x3,x4,...x1024]: > a[i] = False

Installation on Vista (Was: ANN: ActivePython 2.6.0.0 is now available)

2008-11-17 Thread Trent Mick
Mensanator wrote: What about Vista? Do you need to use the Administrator account to install it? My currently understanding is that the ActivePython installer will prompt for administrator privileges if required. I know that if the current user is a member of the administrators *group* (different

Re: Simple question about Python lists

2008-11-17 Thread Eric
On Nov 11, 7:31 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: > > On Wed, 12 Nov 2008 10:08:45 +1100, Ben Finney wrote: > > > >Eric<[EMAIL PROTECTED]> writes: > > >> In MATLAB, if  I just want the first, fifth  and eighth element I > > >> might do something

Re: Suggestions for an education programming project

2008-11-17 Thread Stef Mientki
Eric wrote: Hi, I've been trying to get my son interested in learning some simple programming for a while. While I understand that a structured tutorial is best, I think if we can write something cool at least once, it will encourage him to learn more. While I have a lot of experience with MATLA

Re: ANN: ActivePython 2.6.0.0 is now available

2008-11-17 Thread Mensanator
On Nov 17, 1:45 pm, Trent Mick <[EMAIL PROTECTED]> wrote: > Mensanator wrote: > >> I'm happy to announce that ActivePython 2.6.0.0 is now > >> available for download from: > >>      http://www.activestate.com/Products/activepython/ > >> ... > >> - Windows/x86 > > > What about Vista? Do you need to

Re: compressed serialization module

2008-11-17 Thread Nick Craig-Wood
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > >> I used pickle and found the file was saved in text format. I wonder > >> whether anyone is familiar with a good compact off-the-shelf module > >> available that will save in compressed format... or maybe an opinion > >> on a

Re: Best practise hierarchy for user-defined exceptions

2008-11-17 Thread Nick Craig-Wood
Slaunger <[EMAIL PROTECTED]> wrote: > On 17 Nov., 13:05, "Chris Rebert" <[EMAIL PROTECTED]> wrote: > > On Mon, Nov 17, 2008 at 3:47 AM, Slaunger <[EMAIL PROTECTED]> wrote: > > > > > . > > > Here is my stub-implemented idea on how to do it so far, which is > > > inspired by how I would have don

Re: C Function Pointer Wrapping Example not working

2008-11-17 Thread Nick Craig-Wood
Charlie <[EMAIL PROTECTED]> wrote: > > > > > > ?But when I try to import test in python, it complains: > > > ?import _test > > > ?ImportError: ./_test.so undefined symbol: _Z9binary_opiiPFiiiE > > > > The above is a mangled name so you've got some C vs C++ problems I'd > > say. > > > > You could t

Re: How to read fonts in python

2008-11-17 Thread Robert Kern
Steve Holden wrote: ganesh gajre wrote: Hello all, I am writing a program to convert indic true type font to unicode. For which i need to know how to read the any file i.e Text, Doc, Excel file in python and identify the font used in which that file is written. So that using Map file can conver

Re: Suggestions for an education programming project

2008-11-17 Thread r0g
Eric wrote: > On Nov 17, 1:06 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: >> Eric <[EMAIL PROTECTED]> writes: >>> Hi, >>> I've been trying to get my son interested in learning some simple >>> programming for a while. While I understand that a structured tutorial >>> is best, I think if we can w

Re: install wxPython on windows without admin?

2008-11-17 Thread timw.google
On Nov 17, 9:57 am, Steve Holden <[EMAIL PROTECTED]> wrote: > timw.google wrote: > > The subject line says it all. Is there a way to install wxPython on a > > Windows machine without admin privs? I love the way python doesn't > > need admin to install locally, and I'd like to try wxPython w/o havin

Re: Multiple equates

2008-11-17 Thread Arnaud Delobelle
Arnaud Delobelle <[EMAIL PROTECTED]> writes: > jzakiya <[EMAIL PROTECTED]> writes: > >> I looked online and in books, but couldn't find a definitive answer to >> this. >> >> I have an array and set multiple elements to either True or False at >> one time. >> >> Question: Which way is faster (or do

Re: ANN: ActivePython 2.6.0.0 is now available

2008-11-17 Thread Trent Mick
Mensanator wrote: I'm happy to announce that ActivePython 2.6.0.0 is now available for download from: http://www.activestate.com/Products/activepython/ ... - Windows/x86 What about Vista? Do you need to use the Administrator account to install it? My currently understanding is that the A

Re: Multiple equates

2008-11-17 Thread Tim Chase
It doesn't matter as none of this is valid Python. In Python you have to write array[x1] = False array[x2] = False Uh...not so much... >>> a = [1,2,3,4,5] >>> x1, x2 = 1, 3 >>> a[x1] = a[x2] = False >>> a [1, False, 3, False, 5] Works for me. To the OP, I think rather than cluttering my

Re: Sorting lists

2008-11-17 Thread Terry Reedy
[EMAIL PROTECTED] wrote: Chris Rebert: You use the `key` argument to .sort(): L2.sort(key=lambda item: item[1]) I like the lambda because it's a very readable solution that doesn't require the std lib and it doesn't force the programmer (and the person that reads the code) to learn yet another

Re: Will MySQLdb, the Python shim, be supported for Python 2.6 or 3.x?

2008-11-17 Thread Alia Khouri
John Nagle wrote: >      MySQLdb, the Python shim for MySQL, still supports Python only to > Python 2.5.  See "http://sourceforge.net/projects/mysql-python";.  Are there > any plans to support Python 2.6 or 3.x? Are you running windows? If so, check the forums of the group above, some nice chap ha

Re: Python3 - it's awesome

2008-11-17 Thread Terry Reedy
Eduardo O. Padoan wrote: On Mon, Nov 17, 2008 at 7:30 AM, Johannes Bauer <[EMAIL PROTECTED]> wrote: so far). It was really easy to install it locally as my user (I want to try it out some more before I install it system-wide). You can install it system-wide as "python3.0" or "python3" -- I th

Re: Customizing sequence types

2008-11-17 Thread Terry Reedy
Mr.SpOOn wrote: It seems that I solved my main problem, but I still have some doubt. I thought this would work, but I was wrong. I had to rewrite __eq__ with the same code of __cmp__ Why it doesn't work with __cmp__ or __hash__ ? Sets and dicts use __hash__ and __eq__ together, as documented.

Re: external program crashes when run through subprocess.popen on XP

2008-11-17 Thread James Harris
On 17 Nov, 19:15, ckkart <[EMAIL PROTECTED]> wrote: > Hi, > > on XP when starting a certain external program (plain C calculation > program which communicates via stdout/fs) from python 2.5 using > subprocess.Popen the external program crashes. It does not if started > directly from the XP command

Re: Multiple equates

2008-11-17 Thread Diez B. Roggisch
Arnaud Delobelle wrote: > jzakiya <[EMAIL PROTECTED]> writes: > >> I looked online and in books, but couldn't find a definitive answer to >> this. >> >> I have an array and set multiple elements to either True or False at >> one time. >> >> Question: Which way is faster (or does it matter)? >> >>

Re: Suggestions for an education programming project

2008-11-17 Thread Eric
On Nov 17, 1:06 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > Eric <[EMAIL PROTECTED]> writes: > > Hi, > > > I've been trying to get my son interested in learning some simple > > programming for a while. While I understand that a structured tutorial > > is best, I think if we can write somethin

Re: Multiple equates

2008-11-17 Thread jzakiya
On Nov 17, 2:10 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > jzakiya <[EMAIL PROTECTED]> writes: > > I looked online and in books, but couldn't find a definitive answer to > > this. > > > I have an array and set multiple elements to either True or False at > > one time. > > > Question: Which w

Re: Installing Python2.6 on Mac Os (Leopard)

2008-11-17 Thread Philip Semanchuk
On Nov 17, 2008, at 2:05 PM, Diez B. Roggisch wrote: Sorry if I misinformed; I have such symlinks in /usr/local/bin dated the same day as my custom Python install. I guess I could have created them myself, but I don't think I would have bothered creating a symlink for pythonw, for example si

external program crashes when run through subprocess.popen on XP

2008-11-17 Thread ckkart
Hi, on XP when starting a certain external program (plain C calculation program which communicates via stdout/fs) from python 2.5 using subprocess.Popen the external program crashes. It does not if started directly from the XP command prompt. This is not a purely python problems since the crash oc

Re: Multiple equates

2008-11-17 Thread Arnaud Delobelle
jzakiya <[EMAIL PROTECTED]> writes: > I looked online and in books, but couldn't find a definitive answer to > this. > > I have an array and set multiple elements to either True or False at > one time. > > Question: Which way is faster (or does it matter)? > > 1) > > array[x1]=array[x2]==

Re: Python and Its Libraries--Who's on First?

2008-11-17 Thread Aahz
In article <[EMAIL PROTECTED]>, W. eWatson <[EMAIL PROTECTED]> wrote: >George Sakkis wrote: >> On Nov 17, 12:25 am, "W. eWatson" <[EMAIL PROTECTED]> wrote: >>> >>> Is there some repository that says something like for Python 2.5 it works >>> with: >>> >>> Win OSes: W2K, XP, Vista >>> numpy vers y,

Re: Suggestions for an education programming project

2008-11-17 Thread Arnaud Delobelle
Eric <[EMAIL PROTECTED]> writes: > Hi, > > I've been trying to get my son interested in learning some simple > programming for a while. While I understand that a structured tutorial > is best, I think if we can write something cool at least once, it will > encourage him to learn more. I know it's

Re: Installing Python2.6 on Mac Os (Leopard)

2008-11-17 Thread Diez B. Roggisch
> Sorry if I misinformed; I have such symlinks in /usr/local/bin dated > the same day as my custom Python install. I guess I could have created > them myself, but I don't think I would have bothered creating a > symlink for pythonw, for example since I never use it. > Did you really create a fram

Re: parsing grub's menu.lst

2008-11-17 Thread Albert Hopkins
On Mon, 2008-11-17 at 10:27 -0800, CarlFK wrote: > I need some code that will read in grubs menu.lst file, and give me a > list of dicts: > > [{'title':'Ubuntu, kernel 2.6.15-23-686', > 'root':'(hd0,0)', > 'kernel':'/boot/vmlinuz-2.6.15-23-686 root=/dev/hda1 ro quiet splash', > 'initrd':'/boot/ini

Multiple equates

2008-11-17 Thread jzakiya
I looked online and in books, but couldn't find a definitive answer to this. I have an array and set multiple elements to either True or False at one time. Question: Which way is faster (or does it matter)? 1) array[x1]=array[x2]== array[x10] = \ array[x11]=array[x12]=... = array[x20] =

Re: Socket Programming and Data transer 'advice'

2008-11-17 Thread Chris Rebert
On Mon, Nov 17, 2008 at 10:42 AM, Abah Joseph <[EMAIL PROTECTED]> wrote: > I am planning to develop School Database Management System that will run on > Windows, Linux and Mac. The application will be Server/Client and GUI based. Have you considered basing this off existing software for schools, l

Re: Python-URL! - weekly Python news and links (Nov 17)

2008-11-17 Thread Arnaud Delobelle
[EMAIL PROTECTED] writes: > I guess this goes a long way to explaining why the Python docs > suck so badly in many areas. I like the python docs very much. -- Arnaud -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >