Re: Finding name of variable?

2006-09-11 Thread Gabriel Genellina
At Tuesday 5/9/2006 10:49, Gardner Pomper wrote: I am writing a specialized xml serialization function, and I would like to be able to serialize the value of a simple object with the object name as the tag. For example: first_name = 'Fred' sXML = my_xml_serializer(first_name) should re

Re: are there any lib for receive hotmail ?

2006-09-11 Thread Gabriel Genellina
At Tuesday 5/9/2006 13:05, Tim Chase wrote: > And receiving hotmail (or any outher webmail) using scraping > techniques is a daunting task, to say the least - you should > forget about that IMHO. There's a perl project called "gotmail" that will do the scraping Freepops does that (and a lot m

Re: How to get the "longest possible" match with Python's RE module?

2006-09-11 Thread Tim Peters
[Licheng Fang] > ... > I want to know if there is some way to make Python RE behave like grep > does, Not in general, no. The matching strategies couldn't be more different, and that's both deep and intentional. See Friedl's book for details: http://regex.info/ > or do I have to change to

How to get the package, file, and line of a method/function invocant?

2006-09-11 Thread metaperl
I am looking for something like the caller() routine in Perl: http://perldoc.perl.org/functions/caller.html I am writing a script which needs to be allocated an object containing a set of paths that it will use for reading and writing during it's execution: import os.path class logic: def

Re: How to get the package, file, and line of a method/function invocant?

2006-09-11 Thread Alex Martelli
metaperl <[EMAIL PROTECTED]> wrote: > I am looking for something like the caller() routine in Perl: >http://perldoc.perl.org/functions/caller.html Look at the inspect module in Python's standard library. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: BaseHTTPServer weirdness

2006-09-11 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Steve Holden <[EMAIL PROTECTED]> wrote: > Ron Garret wrote: > > In article <[EMAIL PROTECTED]>, > > Steve Holden <[EMAIL PROTECTED]> wrote: > > > > > >>But basically, you aren't providing a CGI environment, and that's why > >>cgi.parse() isn't working. > > > >

Re: BaseHTTPServer weirdness

2006-09-11 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Kent Johnson <[EMAIL PROTECTED]> wrote: > Steve Holden wrote: > > Ron Garret wrote: > >> In article <[EMAIL PROTECTED]>, > >> Steve Holden <[EMAIL PROTECTED]> wrote: > >> > >> > >>> But basically, you aren't providing a CGI environment, and that's why > >>> cgi.p

Re: BaseHTTPServer weirdness

2006-09-11 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Damjan <[EMAIL PROTECTED]> wrote: > >> But basically, you aren't providing a CGI environment, and that's why > >> cgi.parse() isn't working. > > > > Clearly. So what should I be doing? > > Probably you'll need to read the source of cgi.parse_qs (like Steve did)

Re: Is it just me, or is Sqlite3 goofy?

2006-09-11 Thread Gabriel Genellina
At Tuesday 5/9/2006 16:23, [EMAIL PROTECTED] wrote: I would be surprised if they had never used ANY database. A little thing like dynamic field typing will simply make it impossible to migrate your Sqlite data to a *real* database. Why not? Because it breaks the relational model rules? That mo

Re: How to get the "longest possible" match with Python's RE module?

2006-09-11 Thread MonkeeSage
MonkeeSage wrote: > So, it seems they are all broken, or python is correct as well. Aha, sorry about that Licheng (re: Tim's post). I guess "broken" depends on if you are expecting perl-compatible behavior or otherwise. I have my own scripts I use to do (f)grep and sed-like operations, so I almost

Re: How to get the "longest possible" match with Python's RE module?

2006-09-11 Thread Licheng Fang
Oh, please do have a look at the second link I've posted. There's a table comparing the regexp engines. The engines you've tested probably all use an NFA implementation. MonkeeSage wrote: > Licheng Fang wrote: > > Hi, according to these regexp engine discussions, it's NOT a behavior > > true to an

Re: wxPython, how to autoresize a frame?

2006-09-11 Thread David
Il Sun, 10 Sep 2006 19:15:40 +0200, David ha scritto: > The problem is that, when sizer2 containig hidden controls collapses to > zero dimensions, the panel resizes, but sizer1 and sizer0 don't! > Consequently the frame does not want to autoresize. > > You con dowload the code here: > http://www.

Re: How to get the "longest possible" match with Python's RE module?

2006-09-11 Thread MonkeeSage
Licheng Fang wrote: > Oh, please do have a look at the second link I've posted. There's a > table comparing the regexp engines. The engines you've tested probably > all use an NFA implementation. Sorry! *blush* I admit I skipped over your links. I'll have a look now. BTW, just an idea that may or

Re: How to get the "longest possible" match with Python's RE module?

2006-09-11 Thread Licheng Fang
Thank you very much, Tim and Monkee. In fact, what I'm doing is handle a lot of regular expressions. I wanted to build VERY LONG regexps part by part and put them all into a file for easy modification and maintenance. The idea is like this: (*INT) = \d+ (*DECIMAL) = (*INT)\.(*INT) (*FACTION) = (*

Re: How to get the "longest possible" match with Python's RE module?

2006-09-11 Thread MonkeeSage
Or mabye something like this is better: def matcher(string, pattern): out = '' for match in re.findall(r'\S*%s\S*' % pattern, string): if (len(match) >= len(out)): out = match return out p1 = 'dodad donkeykong dolittle dodaday' p2 = 'oneself self-serving selfsufficient oneselfsuff

Re: How to get the package, file, and line of a method/function invocant?

2006-09-11 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, metaperl wrote: > # Of course I could cheat and pass it, but I don't want to: > > directories = data.storage.logic(__file__) Why do you consider a plain and simple solution cheating? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/pytho

Re: Is it just me, or is Sqlite3 goofy?

2006-09-11 Thread [EMAIL PROTECTED]
Gabriel Genellina wrote: > At Tuesday 5/9/2006 16:23, [EMAIL PROTECTED] wrote: > > >I would be surprised if they had never used ANY database. A little > >thing like dynamic field typing will simply make it impossible to > >migrate your Sqlite data to a *real* database. > > Why not? Because it brea

Re: How to get the package, file, and line of a method/function invocant?

2006-09-11 Thread Miki
> > I am looking for something like the caller() routine in Perl: > >http://perldoc.perl.org/functions/caller.html > > Look at the inspect module in Python's standard library. Or is you're feeling lazy, have a look at the "here" function found in http://www.unixreview.com/documents/s=9133/ur040

Re: How to get the "longest possible" match with Python's RE module?

2006-09-11 Thread Tim Peters
[Licheng Fang[ > ... > In fact, what I'm doing is handle a lot of regular expressions. I > wanted to build VERY LONG regexps part by part and put them all into a > file for easy modification and maintenance. The idea is like this: > > (*INT) = \d+ > (*DECIMAL) = (*INT)\.(*INT) > (*FACTION) = (*DECI

Re: How to get the "longest possible" match with Python's RE module?

2006-09-11 Thread Bryan Olson
Licheng Fang wrote: > Oh, please do have a look at the second link I've posted. There's a > table comparing the regexp engines. The engines you've tested probably > all use an NFA implementation. Unfortunately, the stuff about NFA's is wrong. Friedl's awful book was the first time I saw this confu

<    1   2   3