Re: Regular expression question -- exclude substring

2005-11-07 Thread Bengt Richter
On Mon, 7 Nov 2005 16:38:11 -0800, James Stroud <[EMAIL PROTECTED]> wrote: >On Monday 07 November 2005 16:18, [EMAIL PROTECTED] wrote: >> Ya, for some reason your non-greedy "?" doesn't seem to be taking. >> This works: >> >> re.sub('(.*)(00.*?01) target_mark', r'\2', your_string) > >The non-greed

BayPIGgies: November 10, 7:30pm (Google)

2005-11-07 Thread Aahz
The next meeting of BayPIGgies will be Thurs, November at 7:30pm at Google (Bldg 43, room Tunis). Hasan Diwan will demonstrate a prototype GPS system written in Python. Let's all work to convince him that he doesn't need to rewrite it in Java! BayPIGgies meetings alternate between IronPort (San B

Re: overloading *something

2005-11-07 Thread Robert Kern
James Stroud wrote: > Hello All, > > How does one make an arbitrary class (e.g. class myclass(object)) behave like > a list in method calls with the "*something" operator? What I mean is: > > myobj = myclass() > > doit(*myobj) > > I've looked at getitem, getslice, and iter. What is it if not o

Re: overloading *something

2005-11-07 Thread Ron Adam
James Stroud wrote: > Hello All, > > How does one make an arbitrary class (e.g. class myclass(object)) behave like > a list in method calls with the "*something" operator? What I mean is: You need to base myclass on a list if I understand your question. class myclass(list): def __init__

Re: Returning a value from a Tk dialog

2005-11-07 Thread Ron Adam
Gordon Airporte wrote: > The dialogs in tkColorChooser, tkFileDialog, etc. return useful values > from their creation somehow, so I can do stuff like this: > > filename = tkFileDialog.askopenfilename( master=self ) > > I would like to make a Yes/No/Cancel dialog that can be used the same > wa

problem generating rows in table

2005-11-07 Thread s99999999s2003
hi i wish to generate a table using cgi toprint = [('nickname', 'justme', 'someplace')] print ''' User Name Address ''' for i in range(0,len(toprint)-1): for j in range(0,len(toprint[0])-1): print

Re: overloading *something

2005-11-07 Thread James Stroud
On Monday 07 November 2005 20:21, Robert Kern wrote: > James Stroud wrote: > > Hello All, > > > > How does one make an arbitrary class (e.g. class myclass(object)) behave > > like a list in method calls with the "*something" operator? What I mean > > is: > > > > myobj = myclass() > > > > doit(*myob

Re: overloading *something

2005-11-07 Thread Alex Martelli
Ron Adam <[EMAIL PROTECTED]> wrote: > James Stroud wrote: > > > Hello All, > > > > How does one make an arbitrary class (e.g. class myclass(object)) behave > > like a list in method calls with the "*something" operator? What I mean > > is: > > You need to base myclass on a list if I understand

Re: Using python for writing models: How to run models in restricted python mode?

2005-11-07 Thread vinjvinj
This can not be done at compile time but can be cought at execution time on linux by the following recipe: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/307871 vinjvinj -- http://mail.python.org/mailman/listinfo/python-list

Re: overloading *something

2005-11-07 Thread Leif K-Brooks
James Stroud wrote: > Hello All, > > How does one make an arbitrary class (e.g. class myclass(object)) behave like > a list in method calls with the "*something" operator? What I mean is: > > myobj = myclass() > > doit(*myobj) Make it iterable: >>> class Foo(object): ... def __iter__(se

Re: BayPIGgies: November 10, 7:30pm (Google)

2005-11-07 Thread Alex Martelli
Aahz <[EMAIL PROTECTED]> wrote: > The next meeting of BayPIGgies will be Thurs, November at 7:30pm at > Google (Bldg 43, room Tunis). 1600 Amphitheater Parkway in Mountain View (CA), btw. > Hasan Diwan will demonstrate a prototype GPS system written in Python. > Let's all work to convince him t

Re: problem generating rows in table

2005-11-07 Thread Steve Holden
[EMAIL PROTECTED] wrote: > hi > i wish to generate a table using cgi > toprint = [('nickname', 'justme', 'someplace')] > print ''' > > User > Name > Address > > > ''' > > for i in range(0,len(toprint)-1

Re: overloading *something

2005-11-07 Thread James Stroud
On Monday 07 November 2005 20:36, Alex Martelli wrote: > > > I've looked at getitem, getslice, and iter. What is it if not one of > > > these? > > Obviously James hadn't looked at __iter__ in the RIGHT way! I was attempting to re-define iter of a subclassed list, to find the "magic" method, but i

Re: overloading *something

2005-11-07 Thread Ron Adam
Alex Martelli wrote: > Ron Adam <[EMAIL PROTECTED]> wrote: > > >>James Stroud wrote: >>>And, how about the "**something" operator? >>> >>>James >> >>A dictionary would be pretty much the same except subclassed from a >>dictionary of course. > > > I believe this one is correct (but I have no

Re: problem generating rows in table

2005-11-07 Thread [EMAIL PROTECTED]
len(toprint) -1 seems to be 0 so it seems that the loops are skipped ? why not just : for x in toprint: for y in x: print "%s" % y these suffix things are very prone to error. [EMAIL PROTECTED] wrote: > hi > i wish to generate a table using cgi > toprint = [('nickname', 'justme', 'someplac

Re: gmpy 1.01 rc near... anybody wanna test>

2005-11-07 Thread casevh
Everything works fine with v1.16. I'm sure I was doing something wrong. I shouldn't be testing that late at night. ;-) It looks like the warning about "tp_compare" has been fixed. I will try to build a version for Windows, but that may take me a day or two. Thanks for the updates to gmpy! Case

Re: problem generating rows in table

2005-11-07 Thread Mike Meyer
[EMAIL PROTECTED] writes: > hi > i wish to generate a table using cgi > toprint = [('nickname', 'justme', 'someplace')] > print ''' > > User > Name > Address > > > ''' > > for i in range(0,len(toprint)-1

Re: problem generating rows in table

2005-11-07 Thread s99999999s2003
thanks for all the help. problem solved by taking out range(). -- http://mail.python.org/mailman/listinfo/python-list

Re: gmpy 1.01 rc near... anybody wanna test>

2005-11-07 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: > Everything works fine with v1.16. I'm sure I was doing something wrong. > I shouldn't be testing that late at night. ;-) > > It looks like the warning about "tp_compare" has been fixed. I didn't touch tp_compare specifically, so the fix must have been a side effect (

Re: PyFLTK - an underrated gem for GUI projects

2005-11-07 Thread aum
On Mon, 07 Nov 2005 09:10:32 -0200, Jorge Godoy wrote: > Installing things mean, usually: 8>< Distilling what you've said, it would appear the essence of your argument is "PyFLTK is less desirable because it's not popular", an argument which, despite a level of pragmatic truth, does contain more

ANN: C++ support for Pyrex

2005-11-07 Thread aum
Hi, Many Pyrex users are grateful for the ability to seamlessly integrate Python and C code without the menial tedium of hand-coding extensions in pure C. However, Pyrex has a frustrating lack of C++ support, something its esteemed author doesn't yet have the time to fix. As an interim solution,

R.I.P. Vaults of Parnassus?

2005-11-07 Thread aum
Hi, The Vaults of Parnassus site: http://www.vex.net/parnassus/ has been down for several days, with no resolution available for the vex.net domain. That site was a treasure-trove of Python resources, with a decent search engine. Does anyone know if it'll be coming back up, or if it's mirrored a

Re: Returning a value from a Tk dialog

2005-11-07 Thread Fredrik Lundh
Gordon Airporte wrote: > The dialogs in tkColorChooser, tkFileDialog, etc. return useful values > from their creation somehow, so I can do stuff like this: > > filename = tkFileDialog.askopenfilename( master=self ) > > I would like to make a Yes/No/Cancel dialog that can be used the same > way (re

Re: R.I.P. Vaults of Parnassus?

2005-11-07 Thread Steve Holden
aum wrote: > Hi, > > The Vaults of Parnassus site: > http://www.vex.net/parnassus/ > has been down for several days, with no resolution available for the > vex.net domain. > > That site was a treasure-trove of Python resources, with a decent search > engine. > > Does anyone know if it'll be comi

Re: R.I.P. Vaults of Parnassus?

2005-11-07 Thread Erik Max Francis
aum wrote: > The Vaults of Parnassus site: > http://www.vex.net/parnassus/ > has been down for several days, with no resolution available for the > vex.net domain. It's working fine here. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 20 N 121 53

os.path.getmtime on winXP

2005-11-07 Thread Jorg Rødsjø
[sorry to those reading twice, but I just realised that I had posted this after mucking about with the date on my machine to try to figure this out -- so the message probably went into last months messages for most people including me.] Hi I'm trying to use os.path.getmtime to check if a file

Re: modifying source at runtime - jython case

2005-11-07 Thread Jan Gregor
Kent Johnson wrote: > Jan Gregor wrote: > >> my typical scenario is that my swing application is running, and i see >> some error or chance for improvement - modify sources of app, stop and >> run >> application again. >> so task is to reload class defitions (from source files) and modify also >>

Re: Newbie Alert: Help me store constants pythonically

2005-11-07 Thread Nicola Larosa
> Also my config files have (a tiny bit of) nested > structure, such as: > > Model1( >numBumps = 1 >sizeOfBumps = 2 >transversePlanes = [ > Plane(type=3, z=4), > Plane(type=5, z=6), > Plane(type=3, z=8) > ] > ) > > which I'm not sure the .ini format can eas

Re: socket receive file does not match sent file

2005-11-07 Thread Irmen de Jong
[EMAIL PROTECTED] wrote: > when I test the two program in the same OS, > i mean from a redhat 9 OS to a redhat 9 OS, > It's ok. receivefile match sent file. > > > But when I run receiver on a Redhat 9, > and send file from a windows XP, > the received file's size is randomized. > > May be that

how to stop a loop with ESC key? [newbie]

2005-11-07 Thread mo
Can somebody explain how to stop a WHILE loop in running program by pressing ESC key? mo -- http://mail.python.org/mailman/listinfo/python-list

Re: Class Variable Access and Assignment

2005-11-07 Thread Antoon Pardon
Op 2005-11-07, Christopher Subich schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: >> Op 2005-11-04, Christopher Subich schreef <[EMAIL PROTECTED]>: >>>it's the Python >>>idiosyncracy about operations on mutable types. In this case, += >>>mutates an object, while + returns a new one -- as by

<    1   2   3