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

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 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: 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 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: 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 "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
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: 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 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: 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: 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: 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: 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]>, 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: 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

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 "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

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: 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: How to get the "longest possible" match with Python's RE module?

2006-09-11 Thread Licheng Fang
MonkeeSage wrote: > Licheng Fang wrote: > > Basically, the problem is this: > > > > >>> p = re.compile("do|dolittle") > > >>> p.match("dolittle").group() > > 'do' > > >From what I understand, this isn't python specific, it is the expected > behavior of that pattern in any implementation. You are u

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

2006-09-11 Thread kondal
Licheng Fang wrote: > Basically, the problem is this: > > >>> p = re.compile("do|dolittle") > >>> p.match("dolittle").group() > 'do' > > Python's NFA regexp engine trys only the first option, and happily > rests on that. There's another example: > > >>> p = re.compile("one(self)?(selfsufficient)?")

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

2006-09-11 Thread Paddy
> > I want to know if there is some way to make Python RE behave like grep > does, or do I have to change to another engine? Maybe if you posted a (tested) grep example and data, that does as you want, the group could better understand what you are asking for? - Paddy. -- http://mail.python.or

Re: best small database?

2006-09-11 Thread Alex Martelli
Thorsten Kampe <[EMAIL PROTECTED]> wrote: > * John Salerno (2006-09-11 19:58 +0100) > > Thorsten Kampe wrote: > > > >> But sqlite is not "pure Python" because it's just a wrapper around > >> sqlite (which has to be installed separately)... > > > > But that's the point. Once 2.5 is released, sqli

Re: testing for valid reference: obj vs. None!=obs vs. obj is not None

2006-09-11 Thread Gabriel Genellina
At Monday 4/9/2006 17:02, alf wrote: I have a reference to certain objects. What is the most pythonic way to test for valid reference: By "valid reference" you mean, you have initially: obj = None and you want to detect whether obj is bound to another, different, object, right? if

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

2006-09-11 Thread [EMAIL PROTECTED]
Mike Owens wrote: > On 11 Sep 2006 18:23:50 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > Can you run your car on diesel fuel? > > > > Why not? > > > > Because your car's specification says to use gasoline? > > > > If your car has been designed to run on diesel, you shouldn't > > be say

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

2006-09-11 Thread MonkeeSage
Licheng Fang wrote: > Hi, according to these regexp engine discussions, it's NOT a behavior > true to any implementation. > [snip] Well, I just double-checked in ruby (oniguruma regexp engine): r = Regexp.new("do|dolittle") puts r.match("dolittle")[0] # do r = Regexp.new("one(self)?(sufficient)?

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

2006-09-11 Thread MonkeeSage
Licheng Fang wrote: > Basically, the problem is this: > > >>> p = re.compile("do|dolittle") > >>> p.match("dolittle").group() > 'do' >From what I understand, this isn't python specific, it is the expected behavior of that pattern in any implementation. You are using alternation, which means "eithe

Re: Reading config.ini in PythonWin.

2006-09-11 Thread Gabriel Genellina
At Monday 4/9/2006 15:02, Dennis Lee Bieber wrote: However, looking deeper... The same problem seems to be showing up using ConfigParser... Odd... specifying a default on the .get() seems to override a default set on the instantiation AND overrides the value IN the file... But th

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

2006-09-11 Thread Steve Holden
Mike Owens wrote: > On 9/11/06, Steve Holden <[EMAIL PROTECTED]> wrote: > > >>>Furthermore, I'm not responding to Python's representation of one >>>thing or another. I am responding to some of the ridiculous and unfair >>>criticisms directed at SQLite. Whatever Python did or didn't do, or >>>what

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

2006-09-11 Thread Licheng Fang
Basically, the problem is this: >>> p = re.compile("do|dolittle") >>> p.match("dolittle").group() 'do' Python's NFA regexp engine trys only the first option, and happily rests on that. There's another example: >>> p = re.compile("one(self)?(selfsufficient)?") >>> p.match("oneselfsufficient").gro

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

2006-09-11 Thread Mike Owens
On 9/11/06, Steve Holden <[EMAIL PROTECTED]> wrote: > > Furthermore, I'm not responding to Python's representation of one > > thing or another. I am responding to some of the ridiculous and unfair > > criticisms directed at SQLite. Whatever Python did or didn't do, or > > whatever PySQLite does or

Re: Running python from a usb drive

2006-09-11 Thread Jason
cjl wrote: > Hey all: > > It seems no matter what I do the %1 gets replaced by paramaters sent to > the batch file...there must be some way of "escaping" this, but I can't > find the answer (yet) with google. Anyone? > > -CJL Use two percents in a row turn into a single percentage sign. So you'd

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

2006-09-11 Thread Mike Owens
On 11 Sep 2006 18:23:50 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Can you run your car on diesel fuel? > > Why not? > > Because your car's specification says to use gasoline? > > If your car has been designed to run on diesel, you shouldn't > be saying it has gasoline engine. Duh. No

Re: Running python from a usb drive

2006-09-11 Thread cjl
Hey all: It seems no matter what I do the %1 gets replaced by paramaters sent to the batch file...there must be some way of "escaping" this, but I can't find the answer (yet) with google. Anyone? -CJL -- http://mail.python.org/mailman/listinfo/python-list

Re: Running python from a usb drive

2006-09-11 Thread cjl
Hey all: I'm getting closer. My startpython.bat file is now: path=%PATH%;%CD%Python24;%CD%Python24\libs;%CD%Python24\Scripts;%CD%Python24\Lib\site-packages;%CD%Python24\DLLs set PYTHONPATH=%CD%Python24 ASSOC .py=Python.File ASSOC .pyc=Python.CompiledFile ASSOC .pyo=Python.CompiledFile ASSOC .pyw=

Re: Parsing String, Dictionary Lookups, Writing to Database Table

2006-09-11 Thread [EMAIL PROTECTED]
Rich Shepard wrote: > I need to learn how to process a byte stream from a form reader where each > pair of bytes has meaning according to lookup dictionaries, then use the > values to build an array of rows inserted into a sqlite3 database table. > >Here's the context: The OMR card reader sends

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

2006-09-11 Thread [EMAIL PROTECTED]
Mike Owens wrote: > On 9/11/06, Steve Holden <[EMAIL PROTECTED]> wrote: > > > Sure. But if you go back to the start of the thread you'll remember the > > OP was originally complaining that SQLite was being promoted in the > > Python docs as SQL compliant. > > Define "SQL compliant." That's about a

Re: Running python from a usb drive

2006-09-11 Thread Thorsten Kampe
* Steve Holden (2006-09-12 01:30 +0100) > Thorsten Kampe wrote: >> * Steve Holden (2006-09-11 21:37 +0100) >>>Uwe Hoffmann wrote: cjl schrieb: >I do set pythonpath, see above. is pythonpath really case insensitive on windows ? >>> >>>Only because the Windows filesystem impleme

Re: win32service (wxpython) -- i cannot install service

2006-09-11 Thread kkt49
under code service install => ok _svc_name_ = r'moin_service' _svc_display_name_ = r'moin_service' start_cmd = r"c:\mmde\moin.exe" #info = ['', '', ''] def __init__(self): #self._svc_name = info[0] #self._svc_display_name_ = info[1] #self.start_cmd = in

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

2006-09-11 Thread Steve Holden
Mike Owens wrote: > On 9/11/06, Steve Holden <[EMAIL PROTECTED]> wrote: > > >>Sure. But if you go back to the start of the thread you'll remember the >>OP was originally complaining that SQLite was being promoted in the >>Python docs as SQL compliant. > > > Define "SQL compliant." That's about

Re: BaseHTTPServer weirdness

2006-09-11 Thread Steve Holden
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. > > > Clearly. So what should I be doing? Surely I'm not the first person to > have this pr

Re: Running python from a usb drive

2006-09-11 Thread Steve Holden
Thorsten Kampe wrote: > * Steve Holden (2006-09-11 21:37 +0100) > >>Uwe Hoffmann wrote: >> >>>cjl schrieb: >>> I do set pythonpath, see above. >>> >>>is pythonpath really case insensitive on windows ? >> >>Only because the Windows filesystem implements case-insensitive >>semantics. This is no

Re: How to stop an [Rpyc] server thread?

2006-09-11 Thread Felipe Almeida Lessa
7 Sep 2006 23:38:08 -0700, Tal Einat <[EMAIL PROTECTED]>: > > I'm not an expert in socket programming, but I can't see the > > correlation between the "listener socket" being in timeout mode and a > > different behavior the other sockets.. > > Anyhow the main goal is being able to shut down the thr

Re: How to stop an [Rpyc] server thread?

2006-09-11 Thread Bryan Olson
Saizan wrote: [...] > I tried sock.settimeout(10) before entering the while and so checking > timeout exception on accept() but I experienced a strange behavior, the > clients connections close immediatly, with one of these exceptions on > the client side on their first use of the rpc connection: [

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

2006-09-11 Thread Mike Owens
On 9/11/06, Steve Holden <[EMAIL PROTECTED]> wrote: > Sure. But if you go back to the start of the thread you'll remember the > OP was originally complaining that SQLite was being promoted in the > Python docs as SQL compliant. Define "SQL compliant." That's about as technically precise as saying

Re: BaseHTTPServer weirdness

2006-09-11 Thread Damjan
>> 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) and see what it needs from os.environ and then provide that (either in os.envir

Re: SQLwaterheadretard3 (Was: Is it just me, or is Sqlite3 goofy?)

2006-09-11 Thread Mike Owens
On 9/11/06, Marty <[EMAIL PROTECTED]> wrote: > In all seriousness, the information you present here is great, and > much appreciated. Your sarcastic, condescending tone kind of gets in > the way of the message, though. Sarcastic, perhaps. Condesceding, I think not. It is ridiculous that people ca

Re: best small database?

2006-09-11 Thread Paul Rubin
Larry Bates <[EMAIL PROTECTED]> writes: > As far as "rational extension" is concerned, I think I can relate. > As a developer of imaging systems that store multiple-millions of > scanned pieces of paper online for customers, I can promise you > the file system is quite efficient at storing files (a

Re: best small database?

2006-09-11 Thread Thorsten Kampe
* John Salerno (2006-09-11 19:58 +0100) > Thorsten Kampe wrote: > >> But sqlite is not "pure Python" because it's just a wrapper around >> sqlite (which has to be installed separately)... > > But that's the point. Once 2.5 is released, sqlite is built-in. Unless > there's more to it that I don't

Re: question about including something like sqlite in python

2006-09-11 Thread Ben Finney
John Salerno <[EMAIL PROTECTED]> writes: > I was just thinking, since Python 3.0 is supposed to clean up a lot > of the unnecessary or redundant features of Python and make other > things more streamlined, does it seem to anyone that including > SQLite goes against this goal? To my mind, "unneces

Re: best small database?

2006-09-11 Thread Larry Bates
Blair P. Houghton wrote: > Larry Bates wrote: >> The filesystem is almost always the >> most efficient place to store files, not as blobs in a >> database. > > I could get all theoretical about why that's not so in most cases, > but there are plenty of cases where it is so (especially when the > p

Re: Secure XMLRPC Server / PEM Files

2006-09-11 Thread Daniel Crespo
Hi Laszlo, I have read that. It's the wrapper for the usage of OpenSSL, so I have to install it. I have downloaded the Borland C++ compiler, and I'm doing so right now, but I'm not getting good results yet. I tried to import OpenSSL, it seems to work. Now, I want to try the code I submited earli

Re: Running python from a usb drive

2006-09-11 Thread Thorsten Kampe
* Steve Holden (2006-09-11 21:37 +0100) > Uwe Hoffmann wrote: >> cjl schrieb: >>>I do set pythonpath, see above. >> >> is pythonpath really case insensitive on windows ? > > Only because the Windows filesystem implements case-insensitive > semantics. This is nothing to do with Python: That's no

Re: Running python from a usb drive

2006-09-11 Thread Thorsten Kampe
* cjl (2006-09-11 20:34 +0100) >> Copying the Python24 directory is a good start, but doesn't include the >> enormous number of registry keys that are included in the install and >> are probably needed for the complete capabilites of python. > > Is the source of the windows python installer availa

Problems with email.Generator.Generator - Solved?

2006-09-11 Thread Chris Withers
Chris Withers wrote: > Has no-one ever successfully generated a correctly formatted email with > email.MIMEText where the message includes non-ascii characters?! I'm guessing not ;-) Well, I think I have a winner, but it required me to subclass MIMEText: from email.Charset import Charset,QP fro

Re: BaseHTTPServer weirdness

2006-09-11 Thread Ron Garret
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. Clearly. So what should I be doing? Surely I'm not the first person to have this problem? I have managed to work aroun

Re: auto upgrade scripts?

2006-09-11 Thread Larry Bates
[EMAIL PROTECTED] wrote: > Hello list, > > Is anyone aware of a (light-weight, easy-to-use) > auto-upgrade framework for python scripts? > > I find it hard to believe no one has wanted this before, > yet google doesn't find too much relevant stuff. > > Thanks, > Best regards, > Stefaan. > Auto-

Re: Algorithm Question

2006-09-11 Thread John Machin
Andrew McLean wrote: > Carl Banks wrote: > > Andrew McLean wrote: > >> I have a list of strings, A. I want to find a set of strings B such that > >> for any "a in A" there exists "b in B" such that b is a sub-string of a. > > > > B=A? > > > >> But I also want to minimise T = sum_j t_j where > >> t

Re: Problems with email.Generator.Generator

2006-09-11 Thread Chris Withers
Chris Withers wrote: > print msg.as_string() > > MIME-Version: 1.0 > Content-Type: text/plain; charset; charset="utf-8" ^^^ Actually, even this isn't correct as you can see above... > charset = Charset('utf-8') > msg = MIMEText('','plain',None) > msg.set_payload(u

Re: Looking for the Perfect Editor

2006-09-11 Thread jussij
Omar wrote: > I'd love the perfect editor that would be: Zeus for Windows understands Python, Java Script, HTML an many other languages: http://www.zeusedit.com/features.html Note: Zeus is shareware (45 day trial). It will do Python syntax highlighting, code folding, class browsing, smart

Re: Simple regex with whitespaces

2006-09-11 Thread John Machin
James Stroud wrote: > Paul McGuire wrote: > > <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > >>Hello, > >> > >> I cannot figure out a way to find a regular expression that would > >>match one and only one of these two strings: > [clip] > >>Any suggestion ? Thanks a bunch ! >

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

2006-09-11 Thread Steve Holden
Mike Owens wrote: > I coworker pointed me to this thread. > > and why it isn't SQL. > > >>>It isn't SQL simply because SQL won't let you insert text >>>into a numeric field. > > >>Yup, I have to agree that's pretty crappy. (Makes mental note to limit >>use of SQLite). > > > Ever heard o

Re: Looking for the Perfect Editor

2006-09-11 Thread John Bokma
Jorgen Grahn <[EMAIL PROTECTED]> wrote: > On 10 Sep 2006 16:20:56 GMT, John Bokma <[EMAIL PROTECTED]> wrote: >> "urielka" <[EMAIL PROTECTED]> wrote: >> >>> use Eclipse!!! >> >> Q: how can I do x with A >> A: use B!!! OMG LOLLZZ111!!!11eleven > > No, it was a perfectly reasonable answer. Q: Any t

Re: SQLwaterheadretard3 (Was: Is it just me, or is Sqlite3 goofy?)

2006-09-11 Thread Marty
On 9/11/06, Mike Owens <[EMAIL PROTECTED]> wrote: > I coworker pointed me to this thread. Joy for us. > > < snipped good information > In all seriousness, the information you present here is great, and much appreciated. Your sarcastic, condescending tone kind of gets in the way of the message, t

Re: Running python from a usb drive

2006-09-11 Thread Steve Holden
Uwe Hoffmann wrote: > Steve Holden schrieb: > >>Uwe Hoffmann wrote: >> >> >>>cjl schrieb: >>> >>> >>> I do set pythonpath, see above. >>> >>>is pythonpath really case insensitive on windows ? >> >> >>Only because the Windows filesystem implements case-insensitive >>semantics. This is not

Re: Simple regex with whitespaces

2006-09-11 Thread James Stroud
Paul McGuire wrote: > <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>Hello, >> >> I cannot figure out a way to find a regular expression that would >>match one and only one of these two strings: [clip] >>Any suggestion ? Thanks a bunch ! >>Mathieu >> > > A pyparsing approach i

Re: best small database?

2006-09-11 Thread Aahz
In article <[EMAIL PROTECTED]>, John Salerno <[EMAIL PROTECTED]> wrote: >Thorsten Kampe wrote: >. >> But sqlite is not "pure Python" because it's just a wrapper around >> sqlite (which has to be installed separately)... > >But that's the point. Once 2.5 is released, sqlite is built-in. Unless >th

Re: Problems with email.Generator.Generator

2006-09-11 Thread Chris Withers
Chris Withers wrote: > ...except it gets the transfer encoding wrong, which means Thunderbird > shows =A3 instead of the pound sign that it should :-( > > ...this is down to a pretty lame bit of code in Encoders.py which > basically checks for a unicode error *sigh* OK, slight progress... here

Re: BaseHTTPServer weirdness

2006-09-11 Thread Steve Holden
Ron Garret wrote: > In article <[EMAIL PROTECTED]>, > Steve Holden <[EMAIL PROTECTED]> wrote: > > >>The normal way is >> >>s = cgi.parse() >> >>since the CGI script sees the client network socket (after consumption >>of HTTP headers) as its standard input. > > > Doesn't work. (I even tried s

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

2006-09-11 Thread Preston Hagar
> Unfortunately, I don't think they are going to duplicate the 200 or > so page O'Reilly SQLite book as part of the help system (even if that > book is quite out-of-date; there is one skinny chapter near the end that > explains what changes "will appear" in the version that has been > availab

Re: best small database?

2006-09-11 Thread Blair P. Houghton
Larry Bates wrote: > The filesystem is almost always the > most efficient place to store files, not as blobs in a > database. I could get all theoretical about why that's not so in most cases, but there are plenty of cases where it is so (especially when the person doing the DB doesn't get the id

Re: SQLwaterheadretard3 (Was: Is it just me, or is Sqlite3 goofy?)

2006-09-11 Thread Mike Owens
I coworker pointed me to this thread. >>>and why it isn't SQL. >> It isn't SQL simply because SQL won't let you insert text >> into a numeric field. > Yup, I have to agree that's pretty crappy. (Makes mental note to limit > use of SQLite). Ever heard of check constraints? That's another feature

Re: best small database?

2006-09-11 Thread Paul Rubin
"David Isaac" <[EMAIL PROTECTED]> writes: > I have no experience with database applications. > This database will likely hold only a few hundred items, > including both textfiles and binary files. > > I would like a pure Python solution to the extent reasonable. I usually use anydbm when I want s

Re: Running python from a usb drive

2006-09-11 Thread cjl
Uwe: Thank you for your reply. > is pythonpath really case insensitive on windows ? I think so. After running my batch file, I can load the python interpreter by typing 'python', and can then type 'import django' without error. This lives in the site-packages directory, so it is finding it. How

Re: Running python from a usb drive

2006-09-11 Thread Uwe Hoffmann
Steve Holden schrieb: > Uwe Hoffmann wrote: > >> cjl schrieb: >> >> >>> >>> I do set pythonpath, see above. >>> >> >> is pythonpath really case insensitive on windows ? > > > Only because the Windows filesystem implements case-insensitive > semantics. This is nothing to do with Python: no, i m

Re: Problems with email.Generator.Generator

2006-09-11 Thread Chris Withers
Peter Otten wrote: > Chris Withers wrote: > >> At worst, and most likely based on my past experience of (c)StringIO >> being used to accumulate output, it won't make a jot of difference... > > What past experience? > StringIO.StringIO().write(unichr(128)) cStringIO.StringIO().write(uni

Re: best way of testing a program exists before using it?

2006-09-11 Thread Jorgen Grahn
On Mon, 11 Sep 2006 16:21:04 +0100, Steve Holden <[EMAIL PROTECTED]> wrote: > Hari Sekhon wrote: ... >> What is the best way of making sure that the command is installed on the >> system before I try to execute it, like the python equivalent of the >> unix command "which"? ... > The easiest way t

Re: Running python from a usb drive

2006-09-11 Thread Steve Holden
Uwe Hoffmann wrote: > cjl schrieb: > > >> >>I do set pythonpath, see above. >> > > is pythonpath really case insensitive on windows ? Only because the Windows filesystem implements case-insensitive semantics. This is nothing to do with Python: C:\Steve\Projects\Python\dbimp>dir DB.py Volume

Re: Secure XMLRPC Server / PEM Files

2006-09-11 Thread Laszlo Nagy
Daniel Crespo írta: > Laszlo Nagy wrote: > >>> If you have OpenSSL installed, you can do the following: >>> >>> 1. Create a new directory and place the two attached files in it >>> (openssl.cnf and generate.sh) >>> 2. Run "chmod +x gen_cert.sh ; ./gen_cert.sh yourdomain.com" >>> >> I me

Re: question about including something like sqlite in python

2006-09-11 Thread Sashmit Bhaduri
John Salerno wrote: > This is just me thinking out loud, mind you, but it seems like including > a database module (especially one that many people won't use in favor > of MySQL or PostgreSQL, etc.) is weighing down the standard library. Weighing down the standard library? The latest version of

Re: ubuntu crash

2006-09-11 Thread Jorgen Grahn
On Fri, 8 Sep 2006 22:36:36 -0400, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I typed in apt-get remove python > and everything essentially was wiped off my computer. You should have been told that [long list of important packages] would be removed as well because they depended on Python, the

auto upgrade scripts?

2006-09-11 Thread stefaan . himpe
Hello list, Is anyone aware of a (light-weight, easy-to-use) auto-upgrade framework for python scripts? I find it hard to believe no one has wanted this before, yet google doesn't find too much relevant stuff. Thanks, Best regards, Stefaan. -- http://mail.python.org/mailman/listinfo/python-lis

Re: Secure XMLRPC Server / PEM Files

2006-09-11 Thread Daniel Crespo
Laszlo Nagy wrote: > > > > > > If you have OpenSSL installed, you can do the following: > > > > 1. Create a new directory and place the two attached files in it > > (openssl.cnf and generate.sh) > > 2. Run "chmod +x gen_cert.sh ; ./gen_cert.sh yourdomain.com" > I meant generate.sh instead of gen

Re: Parsing String, Dictionary Lookups, Writing to Database Table

2006-09-11 Thread George Sakkis
Rich Shepard wrote: >I know how I'd do all this in C, but since I'm learning python I have not > found how best to accomplish this despite the books and online references > I've read. Can you post one or more examples of expected input-output pairs ? From your description it's not really clea

Re: Running python from a usb drive

2006-09-11 Thread Uwe Hoffmann
cjl schrieb: > > > I do set pythonpath, see above. > is pythonpath really case insensitive on windows ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for the Perfect Editor

2006-09-11 Thread Jorgen Grahn
On 10 Sep 2006 16:20:56 GMT, John Bokma <[EMAIL PROTECTED]> wrote: > "urielka" <[EMAIL PROTECTED]> wrote: > >> use Eclipse!!! > > Q: how can I do x with A > A: use B!!! OMG LOLLZZ111!!!11eleven No, it was a perfectly reasonable answer. (And I say that even though I (a) hate sloppy writing and (b)

Re: BaseHTTPServer weirdness

2006-09-11 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Steve Holden <[EMAIL PROTECTED]> wrote: > The normal way is > > s = cgi.parse() > > since the CGI script sees the client network socket (after consumption > of HTTP headers) as its standard input. Doesn't work. (I even tried sys.stdin=r.rfile; s=cgi.parse())

Re: Can I make unicode in a repr() print readably?

2006-09-11 Thread Martin v. Löwis
Terry Hancock schrieb: > I don't know about the backwards compatibility issue. I'm not sure > what would be affected. But "print" frequently generates encoded > Unicode output if the stream supports it, so there is no guarantee > whether it produces unicode or string output now. I'm not worried a

efficient text file search -solution

2006-09-11 Thread noro
OK, am not sure why, but fList=file('somefile').read() if fList.find('string') != -1: print 'FOUND' works much much faster. it is strange since i thought 'for line in file('somefile')' is optemized and read pages to the memory, i guess not.. George Sakkis wrote: > noro wrote: > > > Is there

Re: best small database?

2006-09-11 Thread Pierre Quentel
Here are some pure-Python databases : - gadfly : an SQL engine, mature and well tested, works in memory so not fit for large data sets - SnakeSQL : another SQL engine, less mature I think and very slow when I tested it - KirbyBase : stores data in a single file ; uses a more Pythonic syntax (no SQL

Re: Running python from a usb drive

2006-09-11 Thread cjl
Jordan: Thank you for your reply. > If making a usb version of python was that easy, movable python would > be open source. I knew about movable python, but I'm not using it because it's not open source. I guess those guys but some work into it, and feel like a small fee is appropriate, but I gu

Re: Problems with email.Generator.Generator

2006-09-11 Thread Chris Withers
Peter Otten wrote: > What past experience? > StringIO.StringIO().write(unichr(128)) cStringIO.StringIO().write(unichr(128)) > Traceback (most recent call last): > File "", line 1, in ? > UnicodeEncodeError: 'ascii' codec can't encode character u'\x80' in position > 0: ordinal not in ra

Re: BaseHTTPServer weirdness

2006-09-11 Thread Steve Holden
Ron Garret wrote: > I'm trying to figure out how to use BaseHTTPServer. Here's my little > test app: > > = > > #!/usr/bin/python > > from BaseHTTPServer import * > > import cgi > > class myHandler(BaseHTTPRequestHandler): > > def do_GET(r): > s = '' >

Re: pyserial problem: script stops reading

2006-09-11 Thread Steve Holden
Frederic Wenzel wrote: > On 9/9/06, Frederic Wenzel <[EMAIL PROTECTED]> wrote: > >>On 9/9/06, Hendrik van Rooyen <[EMAIL PROTECTED]> wrote: >> >>>| I wrote a script on Linux that uses pyserial to read status messages >>>| from a serial line using readlines(). For now, it just displays what >>>| it

Re: Secure XMLRPC Server / PEM Files

2006-09-11 Thread Laszlo Nagy
> > > If you have OpenSSL installed, you can do the following: > > 1. Create a new directory and place the two attached files in it > (openssl.cnf and generate.sh) > 2. Run "chmod +x gen_cert.sh ; ./gen_cert.sh yourdomain.com" I meant generate.sh instead of gen_cert.sh. Under windows it won't

Re: best way of testing a program exists before using it?

2006-09-11 Thread Rob Wolfe
Steve Holden <[EMAIL PROTECTED]> writes: > Rob Wolfe wrote: >> Hari Sekhon wrote: >> >>>I am writing a wrapper to a binary command to run it and then do >>>something with the xml output from it. >>> >>>What is the best way of making sure that the command is installed on the >>>system before I try

Re: Problems with email.Generator.Generator

2006-09-11 Thread Peter Otten
Chris Withers wrote: > At worst, and most likely based on my past experience of (c)StringIO > being used to accumulate output, it won't make a jot of difference... What past experience? >>> StringIO.StringIO().write(unichr(128)) >>> cStringIO.StringIO().write(unichr(128)) Traceback (most recent

Re: Problems with email.Generator.Generator

2006-09-11 Thread Steve Holden
Chris Withers wrote: > Steve Holden wrote: > >>> Is there a how-to for this anywhere? The email package's docs are >>> short on examples involving charsets, unicode and the like :-( >>> >> Well, it would seem like the easiest approach is to monkey-patch the >> use of cStringIO to StringIO as rec

Re: Secure XMLRPC Server / PEM Files

2006-09-11 Thread Laszlo Nagy
Daniel Crespo írta: Hello everybody, I'm trying to implement a secure xmlrpc server with basis on http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496786 recipe. The thing that I'm concerned about is how can I get/create rapidly the .pem files (the key and cert). Any help? Hello, If

  1   2   3   >