Re: Talking to marketing people about Python
Roy Smith enlightened us with: > I'm working on a product which for a long time has had a Perl > binding for our remote access API. A while ago, I wrote a Python > binding on my own, chatted it up a bit internally, and recently had > a (large) customer enquire about getting access to it. > > I asked for permission to distribute the Python binding, and after a > few weeks of winding its way through the corporate bureaucracy I got > an email from a product manager who wants to meet with me to > "understand the market demand for Python API before we commercialize > it". 1) The customer wants it already. 2) The language is good enough for NASA and Google. Sybren -- Sybren Stüvel Stüvel IT - http://www.stuvel.eu/ -- http://mail.python.org/mailman/listinfo/python-list
Re: QuoteSQL
In message <[EMAIL PROTECTED]>, Sybren Stuvel wrote: > Lawrence D'Oliveiro enlightened us with: >> Yes, I have done blobs. Still need a quoting function for the >> specials, though. > > Why? What makes your data so different from mine? "select * from details where person_name like" " concat(\"%%\", %s, \"%%\")" \ % \ QuoteSQL(name, True) -- http://mail.python.org/mailman/listinfo/python-list
Re: A critique of cgi.escape
In message <[EMAIL PROTECTED]>, Fredrik Lundh wrote: > Georg Brandl wrote: > >> A function is broken if its implementation doesn't match the >> documentation. > > or if it doesn't match the designer's intent. cgi.escape is old enough > that we would have noticed that, by now... _We_ certainly have noticed it. -- http://mail.python.org/mailman/listinfo/python-list
Re: Reverse a String?
[EMAIL PROTECTED] wrote: >> http://pyfaq.infogami.com/ > > Tell me more? > > Clueless newbie me, thru this door I'm at three deaths and counting. > Does that Py Faq Wiki have a sandbox a la alt.test, and/or a tutorial? > > // Death One: > > http://pyfaq.infogami.com/_account/in?path=/ > requires me to create a persisting ID "between 3 and 20 letters and > numbers", i.e., not an e-mail address. Grumble, ok. > > // Death Two: > > http://pyfaq.infogami.com/programming-index > kicked back comment "How can I reverse a string, an array, a list, > etc.?" with "Sorry, that looks like spam. I'm not going to post it." I must say that this has also happened to me before. Fredrik, is there some description of what infogami regards as spam? Do comments have to have a minimum length? That said, hasn't it worked well in the past to use no spam filter, if you have to be registered to post comments? Georg -- http://mail.python.org/mailman/listinfo/python-list
Re: QuoteSQL
Lawrence D'Oliveiro enlightened us with: > "select * from details where person_name like" > " concat(\"%%\", %s, \"%%\")" \ > % \ > QuoteSQL(name, True) Wouldn't this be a whole lot better? cursor.execute( "select * from details where person_name like ?", '%' + name + '%' ) Sybren -- Sybren Stüvel Stüvel IT - http://www.stuvel.eu/ -- http://mail.python.org/mailman/listinfo/python-list
Re: unicode, bytes redux
willie <[EMAIL PROTECTED]> wrote: > Is it too ridiculous to suggest that it'd be nice > if the unicode object were to remember the > encoding of the string it was decoded from? > So that it's feasible to calculate the number > of bytes that make up the unicode code points. So what sort of output do you expect from this: >>> a = '\xc9'.decode('latin1') >>> b = '\xc3\x89'.decode('utf8') >>> print (a+b).bytes() ??? And if you say that's an unfair question because you expected all the byte strings to be using the same encoding then there's no point storing it on every unicode object; you might as well store it once globally. -- http://mail.python.org/mailman/listinfo/python-list
Outlook Addin and py2exe: 2 problems
I recenlty had the same issue, but clearing the build directory and rebuilding again fixed the issue for me -- http://mail.python.org/mailman/listinfo/python-list
Re: unicode, bytes redux
willie <[EMAIL PROTECTED]> writes: > # U+270C > # 11100010 10011100 10001100 > buf = "\xE2\x9C\x8C" > u = buf.decode('UTF-8') > # ... later ... > u.bytes() -> 3 > > (goes through each code point and calculates > the number of bytes that make up the character > according to the encoding) Duncan Booth explains why that doesn't work. But I don't see any big problem with a byte count function that lets you specify an encoding: u = buf.decode('UTF-8') # ... later ... u.bytes('UTF-8') -> 3 u.bytes('UCS-4') -> 4 That avoids creating a new encoded string in memory, and for some encodings, avoids having to scan the unicode string to add up the lengths. -- http://mail.python.org/mailman/listinfo/python-list
Re: QuoteSQL
In message <[EMAIL PROTECTED]>, Sybren Stuvel wrote: > Lawrence D'Oliveiro enlightened us with: >> "select * from details where person_name like" >> " concat(\"%%\", %s, \"%%\")" \ >> % \ >> QuoteSQL(name, True) > > Wouldn't this be a whole lot better? > > cursor.execute( > "select * from details where person_name like ?", > '%' + name + '%' > ) No. Can you figure out why? -- http://mail.python.org/mailman/listinfo/python-list
Re: Unexpected behaviour of csv module
John Machin wrote: > A better workaround IMHO is to strip each *field* after it is received > from the csv reader. In fact, it is very rare that leading or trailing > space in CSV fields is of any significance at all. Multiple spaces > ditto. Just do this all the time: > > row = [' '.join(x.split()) for x in row] The problem with removing the spaces after they are received from the csv reader is if you want to use DictReader. I like to use DictReader, without passing it the field list. The module then reads the field list from the first line, and in this situation you don't get an opportunity to strip the spaces from that. -- http://mail.python.org/mailman/listinfo/python-list
Re: unicode, bytes redux
Paul Rubin wrote: > Duncan Booth explains why that doesn't work. But I don't see any big > problem with a byte count function that lets you specify an encoding: > > u = buf.decode('UTF-8') > # ... later ... > u.bytes('UTF-8') -> 3 > u.bytes('UCS-4') -> 4 > > That avoids creating a new encoded string in memory, and for some > encodings, avoids having to scan the unicode string to add up the > lengths. It requires a fairly large change to code and API for a relatively uncommon problem. How often do you need to know how many bytes an encoded Unicode string takes up without needing the encoded string itself? -- http://mail.python.org/mailman/listinfo/python-list
Re: Looking for opinions
crystalattice wrote: > Bruno Desthuilliers wrote: >> I have few experience with RPG softwares, but if your "domain" logic si >> anything more than trivially complex, it's always better to keep it as >> decoupled as possible from the user interface (unless of course the user >> interface actually is the domain !-). FWIW, this doesn't prevent you >> from using a web framework as the front-end... > > Sorry, but what exactly do you mean by "domain"? Sorry, OOA/D jargon. The "domain" (implied : the "problem domain") is really the core of the application - here all the objects / classes / functions / whatever that constitute your game system. IOW, it's the Model part of the MVC triad. -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')])" -- http://mail.python.org/mailman/listinfo/python-list
Re: unicode, bytes redux
Leif K-Brooks <[EMAIL PROTECTED]> writes: > It requires a fairly large change to code and API for a relatively > uncommon problem. How often do you need to know how many bytes an > encoded Unicode string takes up without needing the encoded string > itself? Shrug. I don't see a real large change--the code would just check for an optional arg and process accordingly. I don't know if the issue comes up often enough to be worth making such accomodations for. I do know that we had an extensive newsgroup thread about it, from which this discussion came, but I haven't paid that much attention. -- http://mail.python.org/mailman/listinfo/python-list
Re: unicode, bytes redux
willie wrote: > (beating a dead horse) > > Is it too ridiculous to suggest that it'd be nice > if the unicode object were to remember the > encoding of the string it was decoded from? Where it's been is irrelevant. Where it's going to is what matters. > So that it's feasible to calculate the number > of bytes that make up the unicode code points. > > # U+270C > # 11100010 10011100 10001100 > buf = "\xE2\x9C\x8C" > > u = buf.decode('UTF-8') > > # ... later ... > > u.bytes() -> 3 > > (goes through each code point and calculates > the number of bytes that make up the character > according to the encoding) Suppose the unicode object was decoded using some encoding other than the one that's going to be used to store the info in the database: | >>> sg = '\xc9\xb5\xb9\xcf' | >>> len(sg) | 4 | >>> u = sg.decode('gb2312') later: u.bytes() => 4 but | >>> len(u.encode('utf8')) | 6 and by the way, what about the memory overhead of storing the name of the encoding (in the above case 7 (6 + overhead))? What would u"abcdef".bytes() produce? An exception? HTH, John -- http://mail.python.org/mailman/listinfo/python-list
Re: Difficulty with maxsplit default value for str.split
Steven D'Aprano <[EMAIL PROTECTED]> writes: > Is it safe for me to pass -1 as the default to maxsplit, meaning > "unlimited splits"? Should the docs be fixed to mention that? Frederik gave a simple and practical solution to your immediate problem, but yes, I think the docs should be fixed after checking the code. -- http://mail.python.org/mailman/listinfo/python-list
Re: unicode, bytes redux
"John Machin" <[EMAIL PROTECTED]> writes: > Actually, what Willie was concerned about was some cockamamie DBMS > which required to be fed Unicode, which it encoded as UTF-8, Yeah, I remember that. > Tell you what, why don't you and Willie get together and write a PEP? If enough people care about the problem, I'd say just submit a code patch. I haven't needed it myself, but I haven't (so far) had to deal with unicode that often. It's a reasonably logical thing to want. Imagine if the normal length(string) function required copying the string around. -- http://mail.python.org/mailman/listinfo/python-list
Re: Unexpected behaviour of csv module
Andrew McLean wrote: > John Machin wrote: > > A better workaround IMHO is to strip each *field* after it is received > > from the csv reader. In fact, it is very rare that leading or trailing > > space in CSV fields is of any significance at all. Multiple spaces > > ditto. Just do this all the time: > > > > row = [' '.join(x.split()) for x in row] > > The problem with removing the spaces after they are received from the > csv reader is if you want to use DictReader. I like to use DictReader, > without passing it the field list. The module then reads the field list > from the first line, and in this situation you don't get an opportunity > to strip the spaces from that. You can fix that. The beauty of open source is that you can grab it (Windows: c:\python2?\lib\csv.py (typically)) and hack it about till it suits your needs. Go fer it! Cheers, John -- http://mail.python.org/mailman/listinfo/python-list
PyOpenGL pour python 2.5 ???
Bonjour à tous, Dans la folie j'ai installé le nouveau python, impatient de voir les nouveautés mais je pense que j'ai été un peu rapide car j'ai voulu utiliser pyOpenGL et là problème il n'existe pas pour python 2.5 ?!!! de plus il semble que pyopengl est été abandonné depuis 2005 ? plus rien ne bouge sur le site... je suis sous windows et je ne dispose pas des outils pour faire moi même une compilation, (en supposant qu'il n'y aurait que ça a faire) alors si quelqu'un a plus d'info pour utiliser l'opengl avec python 2.5... Merci Seb -- http://mail.python.org/mailman/listinfo/python-list
Re: unicode, bytes redux
Paul Rubin wrote: > "John Machin" <[EMAIL PROTECTED]> writes: > > Actually, what Willie was concerned about was some cockamamie DBMS > > which required to be fed Unicode, which it encoded as UTF-8, > > Yeah, I remember that. > > > Tell you what, why don't you and Willie get together and write a PEP? > > If enough people care about the problem, I'd say just submit a code > patch. I haven't needed it myself, but I haven't (so far) had to deal > with unicode that often. It's a reasonably logical thing to want. > Imagine if the normal length(string) function required copying the > string around. Almost as bad: just imagine a language that had a normal strlen(string) function that required mucking all the way through the string until you hit some cockamamie in-band can't-happen-elsewhere sentinel. Cheers, John -- http://mail.python.org/mailman/listinfo/python-list
Re: QuoteSQL
Lawrence D'Oliveiro enlightened us with: >> Wouldn't this be a whole lot better? >> >> cursor.execute( >> "select * from details where person_name like ?", >> '%' + name + '%' >> ) > > No. Can you figure out why? Ok, should have tested it better. This works fine on my machine, though: curs.execute( "select * from details where person_name like ?", ('%' + name + '%', ) ) Including all sorts of quotes, newlines, backslashes etc. in the name. Sybren -- Sybren Stüvel Stüvel IT - http://www.stuvel.eu/ -- http://mail.python.org/mailman/listinfo/python-list
Re: unicode, bytes redux
On Mon, 25 Sep 2006 00:45:29 -0700, Paul Rubin wrote: > willie <[EMAIL PROTECTED]> writes: >> # U+270C >> # 11100010 10011100 10001100 >> buf = "\xE2\x9C\x8C" >> u = buf.decode('UTF-8') >> # ... later ... >> u.bytes() -> 3 >> >> (goes through each code point and calculates >> the number of bytes that make up the character >> according to the encoding) > > Duncan Booth explains why that doesn't work. But I don't see any big > problem with a byte count function that lets you specify an encoding: > > u = buf.decode('UTF-8') > # ... later ... > u.bytes('UTF-8') -> 3 > u.bytes('UCS-4') -> 4 > > That avoids creating a new encoded string in memory, and for some > encodings, avoids having to scan the unicode string to add up the > lengths. Unless I'm misunderstanding something, your bytes code would have to perform exactly the same algorithmic calculations as converting the encoded string in the first place, except it doesn't need to store the newly encoded string, merely the number of bytes of each character. Here is a bit of pseudo-code that might do what you want: def bytes(unistring, encoding): length = 0 for c in unistring: length += len(c.encode(encoding)) return length At the cost of some speed, you can avoid storing the entire encoded string in memory, which might be what you want if you are dealing with truly enormous unicode strings. Alternatively, instead of calling encode() on each character, you can write a function (presumably in C for speed) that does the exact same thing as encode, but without storing the encoded characters, merely adding their lengths. Now you have code duplication, which is usually a bad idea. If for no other reason, some poor schmuck has to maintain them both! (And I bet it won't be Willie, for all his enthusiasm for the idea.) This whole question seems to me like an awful example of premature optimization. Your computer has probably got well in excess of 100MB, and you're worried about duplicating a few hundred or thousand (or even hundred thousand) bytes for a few milliseconds (just long enough to grab the length)? -- Steven D'Aprano -- http://mail.python.org/mailman/listinfo/python-list
Re: Daemonizing python
Paul Rubin wrote: > "Diez B. Roggisch" <[EMAIL PROTECTED]> writes: >> There is a good daemonization recipe on activstate: >> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66012 > > That is worth reading, including the long comment thread. Yeah, it is somewhat disappointing that the version in the comments is not the one upfront. I should have already mentioned that, thanks for doing that. Diez -- http://mail.python.org/mailman/listinfo/python-list
Re: Verify an e-mail-adress - syntax and dns
"Ingo Linkweiler" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Bjoern Schliessmann schrieb: > > Ingo Linkweiler wrote: > > > >> b) verify an existing mailserver or DNS/MX records > > > > "Or"? That's two different things. > > > > If you don't know already: Even if you test all this, it is still > > possible that > > > > - the target mail account doesn't exist > > - the sender's IP is filtered by the server so he'll reject > > Yes, I know this. > But its still better than not checking it. > The script will be used as part auf a user registration page to avoid > dummy-inputs like "[EMAIL PROTECTED]" Why bother, you will loose anyway: For those kind of sites demanding registration for trivial usage (i.e. most sites do) I use my own domain controlled by myself - the adress is valid for the confirmation mail then, after I got what I came for (or after I found out that this site was a waste of time, which happens entirely too often), the adress is not valid anymore. Cuts down the spamvertising a lot! -- http://mail.python.org/mailman/listinfo/python-list
Re: What is the best way to "get" a web page?
something like: os.popen("wget -r3 http://juicypornpics.com";) wget understands the peculiarities of web pages so you do have to. -- http://mail.python.org/mailman/listinfo/python-list
Re: QuoteSQL
Sybren Stuvel <[EMAIL PROTECTED]> wrote: > Ok, should have tested it better. This works fine on my machine, > though: > > curs.execute( > "select * from details where person_name like ?", > ('%' + name + '%', ) > ) > > Including all sorts of quotes, newlines, backslashes etc. in the name. > I think his point was that any '%' characters inside name act like wildcards whereas his version looked for literal percents. This could be an argument for having a utility function to escape the wildcards for this sort of situation, but certainly not an argument for his proposed QuoteSQL. -- http://mail.python.org/mailman/listinfo/python-list
Re: Verify an e-mail-adress - syntax and dns
On Sun, 24 Sep 2006 13:23:03 +0200, Ingo Linkweiler wrote: >> The usual way to cope with this is sending out confirmation mails. No >> need to check if the address is syntactically correct beforehand. > > yes, I do this allready. But it would be nice to do some checks before > to avoid wrong user inputs. Because you like reinventing the wheel and doing the same work twice? By memory, in an thread about the same topic just a few days ago, Fredrik Lundh posted a link to Perl's FAQs that suggests a method for "validating" email addresses: treat it like a password and ask the user to type it twice. That will protect against simple typos and input errors. For everything else, send to it and see what happens. -- Steven D'Aprano -- http://mail.python.org/mailman/listinfo/python-list
Re: PyOpenGL pour python 2.5 ???
Sébastien Ramage wrote: > Bonjour à tous, Hi Sébastien. Wrong newsgroup, I'm afraid - either repost here in english, or post to fr.comp.lang.python... -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')])" -- http://mail.python.org/mailman/listinfo/python-list
Re: unicode, bytes redux
Paul Rubin wrote: > Leif K-Brooks <[EMAIL PROTECTED]> writes: > > It requires a fairly large change to code and API for a relatively > > uncommon problem. How often do you need to know how many bytes an > > encoded Unicode string takes up without needing the encoded string > > itself? > > Shrug. I don't see a real large change--the code would just check for > an optional arg and process accordingly. I don't know if the issue > comes up often enough to be worth making such accomodations for. I do > know that we had an extensive newsgroup thread about it, from which > this discussion came, but I haven't paid that much attention. Actually, what Willie was concerned about was some cockamamie DBMS which required to be fed Unicode, which it encoded as UTF-8, but silently truncated if it was more than the n in varchar(n) ... or something like that. So all he needs is a boolean result: u.willitfit(encoding, width) This can of course be optimised with simple early-loop-exit tests: if n_bytes_so_far + n_remaining_uchars > width: return False elif n_bytes_so_far + n_remaining_uchars * M <= width: return True # where M is the maximum #bytes per Unicode char for the encoding that's being used. Tell you what, why don't you and Willie get together and write a PEP? Cheers, John -- http://mail.python.org/mailman/listinfo/python-list
Re: Difficulty with maxsplit default value for str.split
On Sun, 24 Sep 2006 10:34:31 +0200, Fredrik Lundh wrote: >> But the split method doesn't accept a value of None for maxsplit, and I >> don't know what default value I should be using. > > def mysplit(S, *args): > pre_processing() > result = S.split(*args) > post_processing() > return result Thanks Fredrik, that's *exactly* the sort of insight I was lacking. And now that you've shown me, I can't believe how obvious it is. -- Steven D'Aprano -- http://mail.python.org/mailman/listinfo/python-list
Re: QuoteSQL
In message <[EMAIL PROTECTED]>, Duncan Booth wrote: > Sybren Stuvel <[EMAIL PROTECTED]> wrote: > >> Ok, should have tested it better. This works fine on my machine, >> though: >> >> curs.execute( >> "select * from details where person_name like ?", >> ('%' + name + '%', ) >> ) >> >> Including all sorts of quotes, newlines, backslashes etc. in the name. >> > I think his point was that any '%' characters inside name act like > wildcards whereas his version looked for literal percents. > > This could be an argument for having a utility function to escape the > wildcards for this sort of situation, but certainly not an argument for > his proposed QuoteSQL. Why not? That is exactly one of the options my QuoteSQL offers. -- http://mail.python.org/mailman/listinfo/python-list
Re: QuoteSQL
Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: >> This could be an argument for having a utility function to escape the >> wildcards for this sort of situation, but certainly not an argument for >> his proposed QuoteSQL. > > Why not? That is exactly one of the options my QuoteSQL offers. > Yes, but your code also quotes non-wildcards, and that is precisely the behaviour you don't want here as you should be using a parameterised queries. -- http://mail.python.org/mailman/listinfo/python-list
Makin search on the other site and getting data and writing in xml
Hi is it possible to make search on for example on google without api with a list of words 1- there is word list 2- the script will take the words from the list by turn 3-it iwll make the search 4-will get results 5-will write the results as xml file. i dont mean only google, for other sites aswell I hope we get a result -- http://mail.python.org/mailman/listinfo/python-list
Re: PyOpenGL pour python 2.5 ???
oh! sorry, I made some search on comp.lang.python and fr.comp.lang.python and finally I forgot where I was... My question is : how use pyopengl with python 2.5 ?? it seems that pyopengl was stop on 2005 I'm on windows and I've not tools to recompile pyopengl for python 2.5 (thinking recompilation is the only things) Somebody can help me? Seb Bruno Desthuilliers a écrit : > Sébastien Ramage wrote: > > Bonjour à tous, > > > Hi Sébastien. > > Wrong newsgroup, I'm afraid - either repost here in english, or post to > fr.comp.lang.python... > > > -- > bruno desthuilliers > python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for > p in '[EMAIL PROTECTED]'.split('@')])" -- http://mail.python.org/mailman/listinfo/python-list
Re: PyOpenGL pour python 2.5 ???
Sébastien Ramage wrote: > oh! > sorry, I made some search on comp.lang.python and fr.comp.lang.python > and finally I forgot where I was... > > My question is : > how use pyopengl with python 2.5 ?? > it seems that pyopengl was stop on 2005 Have a look at this thread. I think with pyopengl you'll have to get the source and compile to get it to work on Python 2.5. I'd be surprised if development of this package has stopped completely though. If you give them some time, they will come up with a 2.5 release soon enough. http://groups.google.com/group/comp.lang.python/browse_thread/thread/4d100920de4f271a/09216ab1c36cf898?lnk=gst&q=upgrade+package+to+2.5&rnum=1#09216ab1c36cf898 Regards, Andy -- http://mail.python.org/mailman/listinfo/python-list
Re: QuoteSQL
Duncan Booth enlightened us with: > I think his point was that any '%' characters inside name act like > wildcards whereas his version looked for literal percents. But of course. > This could be an argument for having a utility function to escape > the wildcards for this sort of situation, but certainly not an > argument for his proposed QuoteSQL. Indeed. An escaping function should be small and not do all kinds of escaping for different situations at once. Sybren -- Sybren Stüvel Stüvel IT - http://www.stuvel.eu/ -- http://mail.python.org/mailman/listinfo/python-list
Re: Daemonizing python
Andi Clemens wrote: > Hi, > > what is the main difference of running a python program as a daemon or > as a cronjob? > > I have written a program at work that checks all internet connections of > our failover sites and saves the results in a MySQL-database. > The whole program is made with django (a webframework) so I had to be > sure that the "checking procedure" is done every 30 minutes. With a daemon, you might be able to flag up problems earlier than the periodic check would allow. On the other hand, you *know* that cron will run every 30 minutes. Do you *know* that your daemon will not stop running somehow? I suppose I put more trust in cron than I do in myself. Regards, Andy -- http://mail.python.org/mailman/listinfo/python-list
Re: how to remember login in zope?
astarocean wrote: > how to remember login in zope? > so when user came back , they needn't input username and password > again. > > i'm using zope,extensiveuserfolder and cookiecrumbler, > exuserfolder is set to cookie-based authentication. > > i'm not using cmf or plone , how could i handle this? > thanks a lot. > > i'm working around this for two days and surfing a lot of pages but > still felt confused, any suggestion would be appreciated. This is the wrong list. See http://www.zope.org/Resources/MailingLists Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list
Re: PyOpenGL pour python 2.5 ???
Sébastien Ramage wrote: > oh! > sorry, I made some search on comp.lang.python and fr.comp.lang.python > and finally I forgot where I was... > > My question is : > how use pyopengl with python 2.5 ?? > it seems that pyopengl was stop on 2005 PyOpenGL is still maintained, but most of the development is focused on porting PyOpenGL to ctypes, which should eliminate the need for compilation. > I'm on windows and I've not tools to recompile pyopengl for python 2.5 > (thinking recompilation is the only things) > > Somebody can help me? The binary installer for Python 2.5 should be available soon. You can track its progress through Mike Fletcher's blog: http://blog.vrplumber.com/1633 http://blog.vrplumber.com/1639 http://blog.vrplumber.com/1640 > Seb Hope this helps, Ziga -- http://mail.python.org/mailman/listinfo/python-list
Re: PyOpenGL pour python 2.5 ???
good news ! thank for links to the blog, very usefull now I have to wait seb -- http://mail.python.org/mailman/listinfo/python-list
Re: QuoteSQL
In message <[EMAIL PROTECTED]>, Duncan Booth wrote: > Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: > >>> This could be an argument for having a utility function to escape the >>> wildcards for this sort of situation, but certainly not an argument for >>> his proposed QuoteSQL. >> >> Why not? That is exactly one of the options my QuoteSQL offers. >> > Yes, but your code also quotes non-wildcards... It quotes specials which can cause trouble with MySQL. The specials come in two sets (wildcards and others), but they are both specials. -- http://mail.python.org/mailman/listinfo/python-list
Re: QuoteSQL
In message <[EMAIL PROTECTED]>, Sybren Stuvel wrote: > Duncan Booth enlightened us with: >> I think his point was that any '%' characters inside name act like >> wildcards whereas his version looked for literal percents. > > But of course. > >> This could be an argument for having a utility function to escape >> the wildcards for this sort of situation, but certainly not an >> argument for his proposed QuoteSQL. > > Indeed. An escaping function should be small and not do all kinds of > escaping for different situations at once. Even when the two situations are related? -- http://mail.python.org/mailman/listinfo/python-list
Re: License / Registration key enabled software
In message <[EMAIL PROTECTED]>, T wrote: > We all know that there are many softwares that require some license key > or registration key to enable them. How does one implement something > like this in python? Reliably? Can't be done, in Python or any other language. -- http://mail.python.org/mailman/listinfo/python-list
Re: License / Registration key enabled software
In message <[EMAIL PROTECTED]>, T wrote: >Umm...I was hoping for something simpler and more straight forward. It cannot be done simply or straightforwardly. Or reliably, for that matter. -- http://mail.python.org/mailman/listinfo/python-list
Re: QuoteSQL
In message <[EMAIL PROTECTED]>, Sybren Stuvel wrote: > Duncan Booth enlightened us with: >> I think his point was that any '%' characters inside name act like >> wildcards whereas his version looked for literal percents. > > But of course. > >> This could be an argument for having a utility function to escape >> the wildcards for this sort of situation, but certainly not an >> argument for his proposed QuoteSQL. > > Indeed. An escaping function should be small and not do all kinds of > escaping for different situations at once. Look at it this way: there is _no_ case where you need escaping of wildcards without also escaping other specials. -- http://mail.python.org/mailman/listinfo/python-list
Re: Talking to marketing people about Python
Roy Smith schrieb: > > Can anybody suggest some good material I can give to him which will help > explain what Python is and why it's a good thing, in a way that a > marketing/product management person will understand? please also look for the "Python success stories" There is also a aviation control system running with Python / using Python bindings. Google offers Python bindings and has employed the BDFL and at least one ~bot. I think nobody would doubt that Google has the most knowledge about online services - maybe there is something about Python? You can also point out that Python is especially suited for secure online applications, with more web frameworks than keywords it offers a very high "security through diversity", as no single vulnerabilitie can be exploited across a big enough ecosphere. Harald -- http://mail.python.org/mailman/listinfo/python-list
Re: Converting Perl Web Report to Python
Thanks again Dennis, This should do what I want with additional flexibility... I will develop the code later this week. During this excersize, I have come to really appreciate Python over Perl. I love the Python command line interpreter that allowed me to pretest any code very quickly. What Python learning resource (book web link or both) do you recommend? Pat Dennis Lee Bieber wrote: > On 24 Sep 2006 14:05:29 -0700, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > > download and install the required MySQLdb module. In any event, I > > would like to know how to search and replace a given string in the sql > > to a user supplied value before execution. > > > I would not even want to try to code that. I will mention that the > default mode for MySQLdb is to use %s as the substitution field, and > since both scripts used the same SQL file... > > > For example, lets say that your sql script looks like this: > > > -=-=-=-=-=-=-=-=-=- script1.sql > > select name, URL, description, occurs > > from comics > > where URL like '%MyParam_1%'# Note that "MyParam_1" represents > > a "catch" string. > > order by name; > > > -=-=-=-=-=-=-=-=-=- > > > select name, URL, description, occurs > from comics > where URL like %s > order by name; > > Then, on the cursor.execute() call: > > > > cr.execute(query) #no parameters assumed > > cr.execute(query, ("%" + MyParam_1 + "%",)) > > {MySQLdb /can/ work with a singleton for convenience, but the DB-API > emphasizes a tuple be passed, hence the (... ,) to create a tuple} > > I'm presuming you do not require the "user" to enter the % wildcards > on search terms. > > MySQLdb can also be fed with a dictionary (last time I looked, at > least) so something like: > > select name, URL, description, occurs > from comics > where URL like %(MyParam_1)s or URL like %(MyParam_2)s > order by name; > > and > > params = {} > params["MyParam_1"] = "%" + somevariable + "%" > params["MyParam_2"] = "%" + anotherstring + "%" > cr.execute(query, params) > > may be possible (I've never used this mode, so no confirmation). > -- > WulfraedDennis Lee Bieber KD6MOG > [EMAIL PROTECTED] [EMAIL PROTECTED] > HTTP://wlfraed.home.netcom.com/ > (Bestiaria Support Staff: [EMAIL PROTECTED]) > HTTP://www.bestiaria.com/ -- http://mail.python.org/mailman/listinfo/python-list
Re: Makin search on the other site and getting data and writing in xml
<[EMAIL PROTECTED]> wrote: > is it possible to make search on for example on google without api with > a list of words > 1- there is word list > 2- the script will take the words from the list by turn > 3-it iwll make the search > 4-will get results > 5-will write the results as xml file. http://www.google.com/terms_of_service.html "You may not send automated queries of any sort to Google's system without express permission in advance from Google." -- http://mail.python.org/mailman/listinfo/python-list
Re: Unexpected behaviour of csv module
One could argue that your CSV file is broken. Of course, since CSV is a poorly specified format, that's a pretty weak statement. I don't remember just what your original problem was, but it concerned itself with white space as I recall. Have you tried setting the skipinitialspace parameter in your call to create a reader object? Skip -- http://mail.python.org/mailman/listinfo/python-list
How do I submit fixes for urllib2 & urlparse?
Basically I encountered some smallish problems with a couple of modules and figure I can fix the problems. I did find http://sourceforge.net/projects/python, should I report my problem report there and then assign them to myself to fix (and create test scripts). As you can probably guess I have not provided python fixes before. How complicated is this? eg I am using python 2.4 and 2.5b3. Do I need to get up to speed with 2.6(?) and fix this also? As a newbie which python mailing list should I subscribe to. Please point me to the right URL to answer the above queries. FYI: the problems I encountered are for: 1. Set-cookies in 302 urllib2.httpRedirects. 2. Location: header %20 format problem 3. urlparse.start_tag attribute parsing and HTML syntax error recovery. Cheers NevilleDNZ -- http://mail.python.org/mailman/listinfo/python-list
How to run in background?
Hi all. I know that it's possible to automatically run a Python program in background by giving it the "pyw" extension. This is useful when I release a source ditribution of my program. How could it be possible to do the same thing with an .exe file compiled with py2exe extension? Do I have to write a batch script separately? Thanks in advance -- http://mail.python.org/mailman/listinfo/python-list
Problems with Python 2.5 installer.
I have ran the MSI installer for Python 2.5 several times attempting to install to C: Python, however all of the files are placed in C:\ . The installer is told to only install files for me, beyond that I have only chosen the defaults. If I copy the files after installation, then uninstall Python, I can still use the application. However I am unable to install py2exe since it does not see Python in the registry, py2exe refuses to install when the Python files are in C:\ . The system in am installing on is WinXP SP 2 and I have enough admin rights on the machine to install software. Google turned up nothing useful that I could find, is anyone else seeing this problem? Thanks, Wayne -- http://mail.python.org/mailman/listinfo/python-list
Re: Talking to marketing people about Python
Roy Smith wrote: > I'm working on a product which for a long time has had a Perl binding for > our remote access API. A while ago, I wrote a Python binding on my own, > chatted it up a bit internally, and recently had a (large) customer enquire > about getting access to it. > > I asked for permission to distribute the Python binding, and after a few > weeks of winding its way through the corporate bureaucracy I got an email > from a product manager who wants to meet with me to "understand the market > demand for Python API before we commercialize it". > > Can anybody suggest some good material I can give to him which will help > explain what Python is and why it's a good thing, in a way that a > marketing/product management person will understand? There isn't an immediate economical benefit, but a technician has to care for the "state of the art". It is both a net-effect regarding technologies and developers but also something more vague, which is a little harder to get: a product has to have a certain appeal. Perl might have been a good decision 10 years ago but appears a bit shaddy these days where better designed languages exist with equal power and far more clean APIs. -- http://mail.python.org/mailman/listinfo/python-list
Re: Talking to marketing people about Python
Roy Smith wrote: > > Can anybody suggest some good material I can give to him which will help > explain what Python is and why it's a good thing, in a way that a > marketing/product management person will understand? As a sometimes marketing droid on my day job (please don't tell anyone!) I think you should point out that, while 5-10 years ago Perl was more popular and widely used than Python, Python has been growing at a much higher rate, and by many (most?) measurements, Python is now more widely used than Perl for many types of applications. These measurements are not precise, but all of the below show Python catching or surpassing Perl today: 1. Number of newsgroup postings 2. Number of books published and sold 3. Number of universities offering courses 4. Number of commerical training courses and seminars offered 5. Number of job listings on internet job listing boards. With Python, it's all about growth; the growth rate of Python, by any of the measurements above and others too numerous to mention, is far greater than Perl's growth rate. Any marketing droid worth his salt should be impressed with high growth rates persisting over several years. ;-)) Ron Stephens www.awaretek.com/plf.html -- http://mail.python.org/mailman/listinfo/python-list
Re: Reverse a String?
[EMAIL PROTECTED] wrote: > Next clue? I would have hoped that the suggestion links on the first page would have sent you to http://pyfaq.infogami.com/suggest which is the "right" place to submit new entries. that spam thing looks weird, though; guess I'll have to check with Aaron. -- http://mail.python.org/mailman/listinfo/python-list
Re: A critique of cgi.escape
Lawrence D'Oliveiro wrote: >> Georg Brandl wrote: >> >>> A function is broken if its implementation doesn't match the >>> documentation. >> >> or if it doesn't match the designer's intent. cgi.escape is old enough >> that we would have noticed that, by now... > > _We_ certainly have noticed it. you're not the designer, you're just some random guy who thinks that if you don't understand something at first, it has to be changed, even if it that change would break things for others. maybe you haven't done software long enough to understand that software works better if you use it the way it was intended to be used, but that's no excuse for being stupid. -- http://mail.python.org/mailman/listinfo/python-list
Introduction to Threading with Python, a podcast
Chris Hefele has done an excellent talk about programming with threads using Python, including a fair amount of detail and a look at various related tools and topics. Chris did a lot of research and put a lot of effort into producing this podcast. I find it to be a particularly clear and lucid explanation of the basic principles of programming with threads. This is a far better-than-normal piece of work, so I feel it is worth mentioning here so that interested people can check it out, Go to www.awaretek.com/python/index.html and just click on the top podcast in the list of podcasts there. Ron Stephens -- http://mail.python.org/mailman/listinfo/python-list
Re: QuoteSQL
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Sybren Stuvel > wrote: > > >>Duncan Booth enlightened us with: >> >>>I think his point was that any '%' characters inside name act like >>>wildcards whereas his version looked for literal percents. >> >>But of course. >> >> >>>This could be an argument for having a utility function to escape >>>the wildcards for this sort of situation, but certainly not an >>>argument for his proposed QuoteSQL. >> >>Indeed. An escaping function should be small and not do all kinds of >>escaping for different situations at once. > > > Look at it this way: there is _no_ case where you need escaping of wildcards > without also escaping other specials. Yes, there is, so please lose the bombast. When you use the DB API correctly and paramterise your queries you still need to quote wildcards in search arguments, but you absolutely shouldn't quote the other SQL specials. That's what parameterised queries are for on the first place, and they have a portability advantage among other reasons why you should use them (another's potential efficiency). regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Skype: holdenweb http://holdenweb.blogspot.com Recent Ramblings http://del.icio.us/steve.holden -- http://mail.python.org/mailman/listinfo/python-list
Re: A critique of cgi.escape
Jon Ribbens wrote: > Or if the design, as described in the documentation, is flawed in some > way. it does exactly what it says, and is perfectly usable as is, if you bother to use it the way it was intended to be used. (still waiting for the "jon's enhanced escape" proposal, btw, but I guess it's easier to piss on others than to actually contribute something useful). -- http://mail.python.org/mailman/listinfo/python-list
Leave the putdowns in the Perl community, the Python world does not need them
I was shocked to see the personal insults hurled in this thread: http://groups.google.com/group/comp.lang.python/browse_thread/thread/d0758cb9545cad4b I have been very pleased with Python developers regardless of skill levels in both the IRC channel as well as here - no hot attitudes. No holier than thou put ons. I was just sinking into the comradery and cooperative nature of this new powerful community when I saw that thread. Well, I hope that the fact that 99% of the Python community, from Guido von Rossum on down continues to exemplify how a language can be good and the people can be friendly and that the other 1% get inspired by their positivity and switch as well... -- http://mail.python.org/mailman/listinfo/python-list
Re: One program in different GUI Toolkits
Steve Holden wrote: > [EMAIL PROTECTED] wrote: > > Actually due to lack of documentation and feedback from the mailing > > list, I am fallen out of love with Pythoncard and in love with > > Kiwi/Pygtk. Given the large groundswell support for pygtk, i dont think > > I will be disappointed. > > > > In and out of love in eight hours and six minutes? I'm glad I don't have > a daughter ;-) heheh... I am rather mercurial (oops, no pun intended). I have never held a job in the IT industry for a year in 7 years of professional work: http://www.metaperl.com But I just found out I get a 4-month penalty if I break my current condo lease, so for once, I think I will stay put for a year. -- http://mail.python.org/mailman/listinfo/python-list
Re: One program in different GUI Toolkits
Steve Holden wrote: > [EMAIL PROTECTED] wrote: > > Actually due to lack of documentation and feedback from the mailing > > list, I am fallen out of love with Pythoncard and in love with > > Kiwi/Pygtk. Given the large groundswell support for pygtk, i dont think > > I will be disappointed. > > > > In and out of love in eight hours and six minutes? I'm glad I don't have > a daughter ;-) heheh... I am rather mercurial (oops, no pun intended). I have never held a job in the IT industry for a year in 7 years of professional work: http://www.metaperl.com But I just found out I get a 4-month penalty if I break my current condo lease, so for once, I think I will stay put for a year. -- http://mail.python.org/mailman/listinfo/python-list
Newbie question: PyQt & Form::init()
Hello List, I am trying to learn Python and followed the tutorial at http://www.cs.usfca.edu/~afedosov/qttut/. Being happy that it works, I am now trying to do my own project, but I am having problems with initialization of my form. I want to automatically fill a couple of comboboxes upon starting the program. I read on the net that I simply have to add a function called »Form1.Init()« with the content I wish to have executed at start time. However, it never gets executed, so it seems. When I re-write the application to have the code executed at the press of a button, it works. What am I doing wrong? Sorry for my newbieness ;) -- http://mail.python.org/mailman/listinfo/python-list
Re: Converting Perl Web Report to Python
[EMAIL PROTECTED] wrote: > Thanks again Dennis, > This should do what I want with additional flexibility... I will > develop the code later this week. During this excersize, I have come > to really appreciate Python over Perl. I love the Python command line > interpreter that allowed me to pretest any code very quickly. What > Python learning resource (book web link or both) do you recommend? I have 3 O'Reilly books that are indispensable: "Python Pocket Reference", "Python Cookbook", and "Learning Python" -- http://mail.python.org/mailman/listinfo/python-list
Re: QuoteSQL
Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: >> Indeed. An escaping function should be small and not do all kinds of >> escaping for different situations at once. > > Look at it this way: there is _no_ case where you need escaping of > wildcards without also escaping other specials. You need to engage brain before posting: >>> cursor.execute("select * from example"); pprint(cursor.fetchall()) 3L ((1L, "o'neil"), (2L, "o'leary"), (3L, 'new\nline')) >>> cursor.execute("select * from example where name like concat('%%', %s, '%%')", "'"); pprint(cursor.fetchall()) 2L ((1L, "o'neil"), (2L, "o'leary")) >>> cursor.execute("select * from example where name like concat('%%', %s, '%%')", "\\'"); pprint(cursor.fetchall()) 2L ((1L, "o'neil"), (2L, "o'leary")) >>> cursor.execute("select * from example where name like concat('%%', %s, '%%')", "\n"); pprint(cursor.fetchall()) 1L ((3L, 'new\nline'),) >>> cursor.execute("select * from example where name like concat('%%', %s, '%%')", "\\n"); pprint(cursor.fetchall()) 2L ((1L, "o'neil"), (3L, 'new\nline')) >>> The spurious escaping of the apostrophe does no harm, but spuriously escaping a newline makes the select match the letter 'n' insteal of matching a newline. -- http://mail.python.org/mailman/listinfo/python-list
Re: How do I submit fixes for urllib2 & urlparse?
Neville CD wrote: > Basically I encountered some smallish problems with a couple of modules > and figure I can fix the problems. > > I did find http://sourceforge.net/projects/python, should I report my > problem report there and then assign them to myself to fix (and create > test scripts). > > As you can probably guess I have not provided python fixes before. > > How complicated is this? eg I am using python 2.4 and 2.5b3. Do I need > to get up to speed with 2.6(?) and fix this also? As a newbie which > python mailing list should I subscribe to. > > Please point me to the right URL to answer the above queries. > > FYI: the problems I encountered are for: > 1. Set-cookies in 302 urllib2.httpRedirects. > 2. Location: header %20 format problem > 3. urlparse.start_tag attribute parsing and HTML syntax error recovery. > > Cheers > NevilleDNZ > Neville: It's not that complicated, but normally I believe that only site admins can assign bugs (I could be wrong). You don't need to be "up to date on 2.6" as long as the changes you propose don't collide with other changes made for 2.6 - of which there will probably be relatively few so soon after the release of 2.5. The recommended way for non-committers to suggest changes is by patching your own copy of the SVN version then generating a patch in the form of a diff listing. The problem with this is the difficulty of getting committers to review and apply your patch (they are busy guys, after all). A number of them, however, have undertaken to do so if you review five other patches and report the results. I believe email to python-dev would be an acceptable way to report your results and request review of your patch. It's a good list to lurk on to keep in touch with developments. Keep it up and you may get commit privileges eventually! regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Skype: holdenweb http://holdenweb.blogspot.com Recent Ramblings http://del.icio.us/steve.holden -- http://mail.python.org/mailman/listinfo/python-list
Re: Talking to marketing people about Python
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > 5. Number of job listings on internet job listing boards. I just did a quick survey for Perl and Python jobs on some of the big IT job boards. I came up with: Site Perl Python Hotjobs 2756 655 Monster >1000 317 Dice 4828 803 I'm not sure how I'm going to spin that to a marketing guy to make him think that "by many (most?) measurements, Python is now more widely used than Perl for many types of applications" Has somebody done a historical analysis of job listing growth over the past few years? If there was a graph showing the lines cross in N years, that would be more impressive. -- http://mail.python.org/mailman/listinfo/python-list
Job offer python programmer
Hello, We're looking for a software developer Python/PHP/Ajax/MySQL for web applications (full time job). Maybe someone in this group might be interested in this job. Further information can be found here: About the job: http://www.Axandra.de/python About us: http://www.Axandra.de/company Best regards, Johannes Selbach Axandra GmbH, Ruhrstraße 6, 56410 Montabaur, Germany http://www.Axandra.de - http://www.Axandra.com -- http://mail.python.org/mailman/listinfo/python-list
Re: A critique of cgi.escape
Jon Ribbens wrote: >> since it doesn't deal with encodings at all. > > Why does it need to? cgi.escape is (or should be) dealing with > character strings, not byte sequences. I must admit, > internationalisation is not my forte, so if there's something > I'm missing here I'd love to hear about it. If you're really serious about making things easier to use, shouldn't you look at the whole picture? HTML documents are byte streams, so any transformation from internal character data to HTML must take both escaping and encoding into account. If you and Lawrence have a hard time remembering how to use the existing cgi.escape function, despite it's utter simplicity, surely it would make your life even easier if there was an alternative API that would handle both the easy part (escaping) and the hard part (encoding) ? > By the way, if you could try and put across your proposed arguments as > to why you don't favour this suggested change without the insults and > general rudeness, it would be appreciated. I've already explained that, but since you're convinced that your use case is more important than other use cases, and you don't care about things like stability and respect for existing users of an API, nor the cost for others to update their code and unit tests, I don't see much need to repeat myself. Breaking things just because you think you can simply isn't the Python way of doing things. -- http://mail.python.org/mailman/listinfo/python-list
Re: Job offer python programmer
[EMAIL PROTECTED] writes: > We're looking for a software developer Python/PHP/Ajax/MySQL for web > applications (full time job). Maybe someone in this group might be > interested in this job. > Further information can be found here: > About the job: http://www.Axandra.de/python Well, that page is in German, so I'm guessing you want a German speaker? -- http://mail.python.org/mailman/listinfo/python-list
Re: CONSTRUCT - New/Old Style Classes, build-in/extension types
In article <[EMAIL PROTECTED]>, Ilias Lazaridis <[EMAIL PROTECTED]> wrote: > >Have those old style classes any benefits? Yes, if you want your code to run on Python 2.1 and earlier. -- Aahz ([EMAIL PROTECTED]) <*> http://www.pythoncraft.com/ "LL YR VWL R BLNG T S" -- www.nancybuttons.com -- http://mail.python.org/mailman/listinfo/python-list
Re: Talking to marketing people about Python
Roy Smith wrote: >> 5. Number of job listings on internet job listing boards. > > I just did a quick survey for Perl and Python jobs on some of the big IT > job boards. I came up with: > > Site Perl Python > Hotjobs 2756 655 > Monster >1000 317 > Dice 4828 803 > > I'm not sure how I'm going to spin that to a marketing guy to make him > think that "by many (most?) measurements, Python is now more widely used > than Perl for many types of applications" I think the use of "applications" here implies "new applications", not "applications still in use somewhere". did you try searching for Cobol, btw ? -- http://mail.python.org/mailman/listinfo/python-list
Re: A critique of cgi.escape
In article <[EMAIL PROTECTED]>, Fredrik Lundh wrote: > maybe you haven't done software long enough to understand that > software works better if you use it the way it was intended to be > used, but that's no excuse for being stupid. So what's your excuse? -- http://mail.python.org/mailman/listinfo/python-list
Re: Newbie question: PyQt & Form::init()
Sven Ehret wrote: > Hello List, > > I am trying to learn Python and followed the tutorial at > http://www.cs.usfca.edu/~afedosov/qttut/. Being happy that it works, I am > now trying to do my own project, but I am having problems with > initialization of my form. > > I want to automatically fill a couple of comboboxes upon starting the > program. I read on the net that I simply have to add a function > called »Form1.Init()« with the content I wish to have executed at start > time. However, it never gets executed, so it seems. When I re-write the > application to have the code executed at the press of a button, it works. > What am I doing wrong? Show us more code, and we show you the problem. At least we can try then, until someone finally implements from __future__ import mindreading Diez -- http://mail.python.org/mailman/listinfo/python-list
Re: unicode, bytes redux
John Machin wrote: > Actually, what Willie was concerned about was some cockamamie DBMS > which required to be fed Unicode, which it encoded as UTF-8, but > silently truncated if it was more than the n in varchar(n) ... or > something like that. > > So all he needs is a boolean result: u.willitfit(encoding, width) at what point in the program would that method be used ? how large are the strings, for typical cases ? -- http://mail.python.org/mailman/listinfo/python-list
Re: Timeline for Python?
In article <[EMAIL PROTECTED]>, Blair P. Houghton <[EMAIL PROTECTED]> wrote: >wesley chun wrote: >> >> 1. never write against older versions of Python... you will only >> obsolete your book even faster (well, "sooner") > >I believe there is some market for documentation of older versions of >software. Many installations are constrained by the cost of upgrading >and can not migrate to a newer version. Meanwhile, they are laboring >under the old documentation, which, in the case of open-source stuff, >is often thoroughly inadequate. Books with accurate information would >help them, and would have helped me, in many cases. You did see my advice, seconded by Wes, that any book should cover the version differences? How is that sufficiently inadequate that new books should specifically target older versions? -- Aahz ([EMAIL PROTECTED]) <*> http://www.pythoncraft.com/ "LL YR VWL R BLNG T S" -- www.nancybuttons.com -- http://mail.python.org/mailman/listinfo/python-list
Re: Job offer python programmer
[EMAIL PROTECTED] wrote: > We're looking for a software developer Python/PHP/Ajax/MySQL for web > applications (full time job). Maybe someone in this group might be > interested in this job. don't forget to post to: http://www.python.org/community/jobs/ as well! (see the HOWTO link on that page for details) -- http://mail.python.org/mailman/listinfo/python-list
Re: installation of python-dev
Dominik Müller wrote: > I am running Python2.4.3; I need to install Python-dev (or does anybody know > an easier way to get distutils.core ? that's what I actually need...). umm. distutils is part of the standard library, so it should be part of the core install. what platform are you using, and where did you get the 2.4.3 kit ? -- http://mail.python.org/mailman/listinfo/python-list
Re: A critique of cgi.escape
In article <[EMAIL PROTECTED]>, Fredrik Lundh wrote: > If you're really serious about making things easier to use, shouldn't > you look at the whole picture? HTML documents are byte streams, so > any transformation from internal character data to HTML must take both > escaping and encoding into account. Ever heard of modular programming? I would suggest that you do indeed take a step back and look at the whole picture - it's the whole picture that needs to take escaping and encoding into account. There's nothing to say that cgi.escape should take them both into account in the one function, and in fact as you yourself have already commented, good reasons for it not to, in that it would make it excessively complicated. > If you and Lawrence have a hard time remembering how to use the > existing cgi.escape function, despite it's utter simplicity, surely > it would make your life even easier if there was an alternative API > that would handle both the easy part (escaping) and the hard part > (encoding) ? You seem to be arguing that because, in an ideal world, it would be better to throw away the 'cgi' module completely and start again, it is not worth making minor improvements in what we already have. I would suggest that this is, to put it mildly, not a good argument. > I've already explained that, but since you're convinced that your use > case is more important than other use cases, and you don't care about > things like stability and respect for existing users of an API, nor > the cost for others to update their code and unit tests, I don't see > much need to repeat myself. You are merely compounding your bad manners. All of your above allegations are outright lies. I am not sure if you are simply not understanding the simple points I am making, or are deliberately trying to mislead people for some bizarre reason of your own. > Breaking things just because you think you can simply isn't the > Python way of doing things. Your hyperbole is growing more extravagant. To begin with, you were claiming that the suggested change would make things (minisculely) less efficient, now you're claiming it will "break" unspecified things. What precisely do you think it would "break"? -- http://mail.python.org/mailman/listinfo/python-list
Re: Newbie question: PyQt & Form::init()
Diez B. Roggisch wrote: > Sven Ehret wrote: > >> Hello List, >> >> I am trying to learn Python and followed the tutorial at >> http://www.cs.usfca.edu/~afedosov/qttut/. Being happy that it works, I am >> now trying to do my own project, but I am having problems with >> initialization of my form. >> >> I want to automatically fill a couple of comboboxes upon starting the >> program. I read on the net that I simply have to add a function >> called »Form1.Init()« with the content I wish to have executed at start >> time. However, it never gets executed, so it seems. When I re-write the >> application to have the code executed at the press of a button, it works. >> What am I doing wrong? > > Show us more code, and we show you the problem. At least we can try then, > until someone finally implements > > from __future__ import mindreading > > Diez Oh, sorry. *blush* here is my code (two files): form1.py: # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'form1.ui' # # Created: Mo Sep 25 15:38:56 2006 # by: The PyQt User Interface Compiler (pyuic) 3.14.1 # # WARNING! All changes made in this file will be lost! from qt import * class Form1(QDialog): def __init__(self,parent = None,name = None,modal = 0,fl = 0): QDialog.__init__(self,parent,name,modal,fl) if not name: self.setName("Form1") self.pushButton1 = QPushButton(self,"pushButton1") self.pushButton1.setGeometry(QRect(410,340,80,30)) self.comboBox1 = QComboBox(0,self,"comboBox1") self.comboBox1.setGeometry(QRect(310,10,120,31)) self.comboBox1.setSizeLimit(12) self.comboBox1.setMaxCount(12) self.comboBox2 = QComboBox(0,self,"comboBox2") self.comboBox2.setGeometry(QRect(431,10,60,31)) self.buttonGroup1 = QButtonGroup(self,"buttonGroup1") self.buttonGroup1.setGeometry(QRect(10,50,480,200)) self.pushButton3 = QPushButton(self,"pushButton3") self.pushButton3.setGeometry(QRect(200,320,101,24)) self.textLabel1 = QLabel(self,"textLabel1") self.textLabel1.setGeometry(QRect(71,10,160,30)) self.languageChange() self.resize(QSize(504,380).expandedTo(self.minimumSizeHint())) self.clearWState(Qt.WState_Polished) self.connect(self.pushButton1,SIGNAL("clicked()"),self.close) self.connect(self.comboBox1,SIGNAL("activated(const QString&)"),self.AddMonthsToCombo) self.connect(self.pushButton3,SIGNAL("clicked()"),self.AddMonthsToCombo) def languageChange(self): self.setCaption(self.__tr("Form1")) self.pushButton1.setText(self.__tr("Beenden")) self.buttonGroup1.setTitle(QString.null) self.pushButton3.setText(self.__tr("pushButton3")) self.textLabel1.setText(self.__tr("textLabel1")) def AddMonthsToCombo(self): import time self.comboBox1.insertItem("Januar") self.comboBox1.insertItem("Februar") self.comboBox1.insertItem("MÀrz") self.comboBox1.insertItem("April") self.comboBox1.insertItem("Mai") self.comboBox1.insertItem("Juni") self.comboBox1.insertItem("Juli") self.comboBox1.insertItem("August") self.comboBox1.insertItem("September") self.comboBox1.insertItem("Oktober") self.comboBox1.insertItem("November") self.comboBox1.insertItem("Dezember") self.comboBox2.insertItem("2005") self.comboBox2.insertItem("2006") self.comboBox2.insertItem("2007") self.comboBox2.insertItem("2008") s = time.strftime("%B") t = time.strftime("%Y") self.comboBox1.setCurrentText(s) self.comboBox2.setCurrentText(t) def __tr(self,s,c = None): return qApp.translate("Form1",s,c) this gets executed by this »wrapper«-script as shown to me in the tutorial: mygui.py from qt import * from form1 import * import time import sys if __name__ == "__main__": app = QApplication(sys.argv) f = Form1() f.show() app.setMainWidget(f) app.exec_loop() -- http://mail.python.org/mailman/listinfo/python-list
Re: AttributeError Question
"Javier Subervi" <[EMAIL PROTECTED]> wrote: > This came up when trying to load a Zope product: > >* Module Products.PageTemplates.ZRPythonExpr, line 47, in __call__ > __traceback_info__: field.Vocabulary(here) >* Module Python expression "field.Vocabulary(here)", line 1, in > >* Module Products.Archetypes.Field, line 432, in Vocabulary >* Module Products.Archetypes.utils, line 145, in mapply >* Module Products.EasyDocument.content.EasyDocument, line 112, in > _list_templates >* Module OFS.Traversable, line 161, in unrestrictedTraverse > __traceback_info__: ([], 'EasyDocumentTemplates') >* Module Products.Archetypes.BaseObject, line 1072, in __bobo_traverse__ > > AttributeError: EasyDocumentTemplates > > Can you tell me what I should do with Attribute Errors in general? The docs > say an > AttributeError is "Raised when an attribute reference or assignment fails." > Okay, fine... > where do I go from here? in general, you get an AttributeError if you try to execute e.g. obj.foo where "obj" is an object but the "foo" attribute doesn't exist. in your case, the AttributeError seems to be occurring deep down inside Zope, which makes it a bit hard to figure out exactly what you been doing wrong (if anything). It could be a bug in your code, or a bug in Zope, or a bug in some module you're using. it's probably best to post this to a Zope-specific mailing list. -- http://mail.python.org/mailman/listinfo/python-list
Re: A critique of cgi.escape
Jon Ribbens <[EMAIL PROTECTED]> wrote: >> and will also break unit tests. > > Er, so change the unit tests at the same time? It is generally a principle of Python that new releases maintain backward compatability. An incompatible change such proposed here would probably break many tests for a large number of people. If the change were seen as a good thing, then a backwards compatible change (e.g. introducing a function with a different name) might be considered, but if so it should address the whole issue: the current lack of support for encodings is IMHO a far bigger problem than whether or a quote mark is escaped. > Why does it need to? cgi.escape is (or should be) dealing with > character strings, not byte sequences. I must admit, > internationalisation is not my forte, so if there's something > I'm missing here I'd love to hear about it. If I have a unicode string such as: u'\u201d' (right double quote), then I want that encoded in my html as '”' (or ” but the numeric form is better). For many purposes I could just encode it in the encoding to be used for the page, typically latin1 or utf8, but sometimes that isn't possible e.g. if you don't know the encoding at the point when you produce the string, or if there is no translation for the character in the desired encoding. The character reference will work whatever encoding is used for the page. There should be a one-stop shop where I can take my unicode text and convert it into something I can safely insert into a generated html page; at present I need to call both cgi.escape and s.encode to get the desired effect. -- http://mail.python.org/mailman/listinfo/python-list
Re: A critique of cgi.escape
In article <[EMAIL PROTECTED]>, Fredrik Lundh wrote: > (still waiting for the "jon's enhanced escape" proposal, btw, but I guess it's > easier to piss on others than to actually contribute something useful). Well, yes, you certainly seem to be good at the "pissing on others" part, even if you have to lie to do it. You have had the "enhanced escape" proposal all along - it was the post which started this thread! If you are referring to your strawman argument about encodings, you have yet to show that it's relevant. If it'll make you any happier, here's the code for the 'cgi.escape' equivalent that I usually use: _html_encre = re.compile("[&<>\"'+]") _html_encodes = { "&": "&", "<": "<", ">": ">", "\"": """, "'": "'", "+": "+" } def html_encode(raw): return re.sub(_html_encre, lambda m: _html_encodes[m.group(0)], raw) -- http://mail.python.org/mailman/listinfo/python-list
Re: what is the best practice to separate Pygtk and long running thread code
seb wrote: > The best thing would be to have a queue feature that would be be shared > between processes but as far as I know It does not exists in python. There is a queue class to share data between threads: http://docs.python.org/lib/module-Queue.html -- Thomas Güttler, http://www.thomas-guettler.de/ http://www.tbz-pariv.de/ E-Mail: guettli (*) thomas-guettler + de Spam Catcher: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list
Re: Unexpected behaviour of csv module
[EMAIL PROTECTED] wrote: > One could argue that your CSV file is broken. Hi Skip, His CSV file is mildly broken. The examples that I gave are even more broken, and are typical of real world files created by clueless developers from databases which contain quotes and commas in the data (e.g. addresses). The brokenness is not the point at issue. The point is that the csv module is weakly silent about the brokenness and in some cases munges the data even further. > Of course, since CSV is a > poorly specified format, that's a pretty weak statement. It would help if the csv module docs did specify what format it expects/allows on reading, and what it does on writing. How to quote a field properly isn't all that mindbogglingly difficult (leaving out options like escapechar and more-than-minimal quoting): qc = quotechar if qc in field: out = qc + field.replace(qc, qc+qc) + qc elif delimiter in field or '\n' in field or '\r' in field: out = qc + field + qc else: out = field Notice how if there are any special characters in the input, the output has a quotechar at each end. If not, it's broken, and detectably broken: abc"def ___^ unexpected quote inside unquoted field "abc"def _^ after quote, expected quote, delimiter, or end-of-line > I don't remember > just what your original problem was, but it concerned itself with white > space as I recall. Have you tried setting the skipinitialspace parameter in > your call to create a reader object? > The problem has nothing to do with *initial* spaces; the OP's problem cases involved *trailing* spaces. And that's only a subset of the real problem: casual attitude towards fields that contain quotes but don't start and/or end with quotes i.e. they have *not* been created by applying the usual quoting algorithm to raw data. HTH, John -- http://mail.python.org/mailman/listinfo/python-list
Re: A critique of cgi.escape
Jon Ribbens wrote: > There's nothing to say that cgi.escape should take them both into account > in the one function so what exactly are you using cgi.escape for in your code ? > What precisely do you think it would "break"? existing code, and existing tests. -- http://mail.python.org/mailman/listinfo/python-list
Re: A critique of cgi.escape
Fredrik Lundh skrev: > Jon Ribbens wrote: >> By the way, if you could try and put across your proposed arguments as >> to why you don't favour this suggested change without the insults and >> general rudeness, it would be appreciated. > > I've already explained that, but since you're convinced that your use > case is more important than other use cases, and you don't care about > things like stability and respect for existing users of an API, nor > the cost for others to update their code and unit tests, I don't see > much need to repeat myself. Breaking things just because you think > you can simply isn't the Python way of doing things. This thread is highly entertaining but perhaps not that productive. Lawrence is right that the escape method doesn't work the way he expects it to. Rewriting a library module simply because a developer is surprised is a *very* bad idea. It would break just about every web app out there that uses the escape module and uses testing. Which is probably most of them. That could mean several man years of wasted time. It also makes the escaped html harder to read for standard cases. Frederik is right that doing so is utterly ... well let us call it "unproductive". Stupid is such a harsh word ;-) Whether someone finds the bloat miniscule and thus a small enough change to warrant the rewrite does not really matter. Lawrence is free to write a wrapper and use that instead. my_escape = lambda st: cgi.escape(st, 1) So. Lawrence is happy, and the escape works as expected. Several man years has been saved. Max M -- http://mail.python.org/mailman/listinfo/python-list
Re: Leave the putdowns in the Perl community, the Python world does not need them
metaperl wrote: > I was shocked to see the personal insults hurled in this thread: > http://groups.google.com/group/comp.lang.python/browse_thread/thread/d0758cb9545cad4b I see that this is a Fredrik Lundh thread. I've felt the same way before, but Fredrik has been around a long time[1] and if you listen through the sometimes sharp words, he really has a lot of intelligent things to say. All I can advise is that if you feel like Fredrik is getting under your skin, take a deep breath and read a different thread for a while. I promise you, it's worth it! STeVe [1] He's the author of Python's unicode support and Python 2.5's elementtree module. -- http://mail.python.org/mailman/listinfo/python-list
Re: unicode, bytes redux
willie wrote: > (beating a dead horse) > > Is it too ridiculous to suggest that it'd be nice > if the unicode object were to remember the > encoding of the string it was decoded from? > So that it's feasible to calculate the number > of bytes that make up the unicode code points. > > # U+270C > # 11100010 10011100 10001100 > buf = "\xE2\x9C\x8C" > > u = buf.decode('UTF-8') > > # ... later ... > > u.bytes() -> 3 > > (goes through each code point and calculates > the number of bytes that make up the character > according to the encoding) Yup, it's a dead horse. As suggested elsewhere in the thread, the unicode object is not the proper place for this functionality. Also, as suggested, it's not even the desired functionality: what's really wanted is the ability to tell how long the string is going to be in various encodings. That's easy enough to do today - just encode the darn thing and use len(). I don't see any reason to expand the language to support a data base product that goes out of its way to make it difficult for developers. John Roth -- http://mail.python.org/mailman/listinfo/python-list
Re: Newbie question: PyQt & Form::init()
Sven Ehret wrote: > Diez B. Roggisch wrote: > >> Sven Ehret wrote: >> >>> Hello List, >>> >>> I am trying to learn Python and followed the tutorial at >>> http://www.cs.usfca.edu/~afedosov/qttut/. Being happy that it works, I >>> am now trying to do my own project, but I am having problems with >>> initialization of my form. >>> >>> I want to automatically fill a couple of comboboxes upon starting the >>> program. I read on the net that I simply have to add a function >>> called »Form1.Init()« with the content I wish to have executed at start >>> time. However, it never gets executed, so it seems. When I re-write the >>> application to have the code executed at the press of a button, it >>> works. What am I doing wrong? >> >> Show us more code, and we show you the problem. At least we can try then, >> until someone finally implements >> >> from __future__ import mindreading >> >> Diez > > Oh, sorry. *blush* > here is my code (two files): > > form1.py: > # -*- coding: utf-8 -*- > > # Form implementation generated from reading ui file 'form1.ui' > # > # Created: Mo Sep 25 15:38:56 2006 > # by: The PyQt User Interface Compiler (pyuic) 3.14.1 > # > # WARNING! All changes made in this file will be lost! > > > from qt import * > > > class Form1(QDialog): > def __init__(self,parent = None,name = None,modal = 0,fl = 0): > QDialog.__init__(self,parent,name,modal,fl) > > if not name: > self.setName("Form1") > > > > self.pushButton1 = QPushButton(self,"pushButton1") > self.pushButton1.setGeometry(QRect(410,340,80,30)) > > self.comboBox1 = QComboBox(0,self,"comboBox1") > self.comboBox1.setGeometry(QRect(310,10,120,31)) > self.comboBox1.setSizeLimit(12) > self.comboBox1.setMaxCount(12) > > self.comboBox2 = QComboBox(0,self,"comboBox2") > self.comboBox2.setGeometry(QRect(431,10,60,31)) > > self.buttonGroup1 = QButtonGroup(self,"buttonGroup1") > self.buttonGroup1.setGeometry(QRect(10,50,480,200)) > > self.pushButton3 = QPushButton(self,"pushButton3") > self.pushButton3.setGeometry(QRect(200,320,101,24)) > > self.textLabel1 = QLabel(self,"textLabel1") > self.textLabel1.setGeometry(QRect(71,10,160,30)) > > self.languageChange() > > self.resize(QSize(504,380).expandedTo(self.minimumSizeHint())) > self.clearWState(Qt.WState_Polished) > > self.connect(self.pushButton1,SIGNAL("clicked()"),self.close) > self.connect(self.comboBox1,SIGNAL("activated(const > QString&)"),self.AddMonthsToCombo) When you just invoke self.AddMonthsToCombo() here, things should work. Diez -- http://mail.python.org/mailman/listinfo/python-list
Re: A critique of cgi.escape
In article <[EMAIL PROTECTED]>, Duncan Booth wrote: > It is generally a principle of Python that new releases maintain backward > compatability. An incompatible change such proposed here would probably > break many tests for a large number of people. Why is the suggested change incompatible? What code would it break? I agree that it would be a bad idea if it did indeed break backwards compatibility - but it doesn't. > There should be a one-stop shop where I can take my unicode text and > convert it into something I can safely insert into a generated html page; I disagree. I think that doing it in one is muddled thinking and liable to lead to bugs. Why not keep your output as unicode until it is ready to be output to the browser, and encode it as appropriate then? Character encoding and character escaping are separate jobs with separate requirements that are better off handled by separate code. -- http://mail.python.org/mailman/listinfo/python-list
Deprecation in String.joinfields()
Hi All, I am getting the following error while trying to use deprecation Please help >>> li = ["a", "b", "mpilgrim", "z", "example"] >>> newname = string.joinfields (li[:-1], ".") >>> newname 'a.b.mpilgrim.z' >>> newname = li[:-1].joinfields(".") Traceback (most recent call last): File "", line 1, in ? AttributeError: 'list' object has no attribute 'joinfields' >>> newname1 = string.join (li[:-1], ".") >>> newname1 'a.b.mpilgrim.z' >>> newname = li[:-1].joinfields(".") Traceback (most recent call last): File "", line 1, in ? AttributeError: 'list' object has no attribute 'join' Thank you for your help Anoop -- http://mail.python.org/mailman/listinfo/python-list
Re: A critique of cgi.escape
In article <[EMAIL PROTECTED]>, Fredrik Lundh wrote: >> There's nothing to say that cgi.escape should take them both into account >> in the one function > > so what exactly are you using cgi.escape for in your code ? To escape characters so that they will be treated as character data and not control characters in HTML. >> What precisely do you think it would "break"? > > existing code, and existing tests. I'm sorry, that's not good enough. How, precisely, would it break "existing code"? Can you come up with an example, or even an explanation of how it *could* break existing code? -- http://mail.python.org/mailman/listinfo/python-list
Re: Verify an e-mail-adress - syntax and dns
Steven D'Aprano a écrit : > By memory, in an thread about the same topic just a few days ago, Fredrik > Lundh posted a link to Perl's FAQs that suggests a method for "validating" > email addresses: treat it like a password and ask the user to type it > twice. That will protect against simple typos and input errors. I hate that thing. When I see that, I type my email once and copy/paste into the second edit box. This is useless AND annoying at the same time. -- http://mail.python.org/mailman/listinfo/python-list
Re: unicode, bytes redux
Fredrik Lundh wrote: > John Machin wrote: > > > Actually, what Willie was concerned about was some cockamamie DBMS > > which required to be fed Unicode, which it encoded as UTF-8, but > > silently truncated if it was more than the n in varchar(n) ... or > > something like that. > > > > So all he needs is a boolean result: u.willitfit(encoding, width) > > at what point in the program would that method be used ? Never, I hope. Were you taking that as a serious suggestion? Fredrik, perhaps your irony detector needs a little preventative maintenance :-) > > how large are the strings, for typical cases ? He did mention it several posts ago -- I recall varchar(50) or something like that. IOW as Duncan Booth said in effect at the start of the 1st thread, the OP's got more problems that just doubling up on u.encode('utf8') ... Cheers, John -- http://mail.python.org/mailman/listinfo/python-list
Re: A critique of cgi.escape
Max M wrote: > It also makes the escaped html harder to read for standard cases. and slows things down a bit. (cgi.escape(s, True) is slower than cgi.escape(s), for reasons that are obvious for anyone who's looked at the code). -- http://mail.python.org/mailman/listinfo/python-list
Re: Replacing line in a text file
CSUIDL PROGRAMMEr wrote: > Folks > I am trying to read a file > This file has a line containing string 'disable = yes' > > I want to change this line to 'disable = no' > > The concern here is that , i plan to take into account the white spaces > also. > > I tried copying all file int list and then tried to manipulate that > list > > But the search is not working > > Any answer > > thanks > Something simple like (not tested): fp=open(filename, 'r') data=fp.read() fp.close() data='disable = yes'.join(data.split('disable = no',1)) fp=open(filename, 'w') fp.write(data) fp.close() -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list
Re: installation of python-dev
Fredrik Lundh wrote: > Dominik M�ller wrote: > >> I am running Python2.4.3; I need to install Python-dev (or does anybody >> know an easier way to get distutils.core ? that's what I actually >> need...). > > umm. distutils is part of the standard library, so it should be part of > the core install. what platform are you using, and where did you get the > 2.4.3 kit ? I guess it is some linuxish system, as he talks about dev-packages. Unfortunately, quite a few distros (debian based ones and Suse to my knowledge) in fact remove distutils from the core and make it available as extra devel package. For whatever reason... diez -- http://mail.python.org/mailman/listinfo/python-list
Re: A critique of cgi.escape
Jon Ribbens wrote: > In article <[EMAIL PROTECTED]>, Fredrik Lundh wrote: >>> There's nothing to say that cgi.escape should take them both into account >>> in the one function >> >> so what exactly are you using cgi.escape for in your code ? > > To escape characters so that they will be treated as character data > and not control characters in HTML. > >>> What precisely do you think it would "break"? >> >> existing code, and existing tests. > > I'm sorry, that's not good enough. How, precisely, would it break > "existing code"? Can you come up with an example, or even an > explanation of how it *could* break existing code? Is that so hard to see? If cgi.escape replaced "'" with an entity reference, code that expects it not to do so would break. Georg -- http://mail.python.org/mailman/listinfo/python-list
Python API to OS X Address Book?
Essentially, I'm looking for a Python equivalent to the ObjectiveC stuff that can be found at: http://developer.apple.com/documentation/UserExperience/Conceptual/AddressBook/index.html Google got me that far, but was not particularly helpful past that. Anyone have any pointers? B. -- http://mail.python.org/mailman/listinfo/python-list
Re: Verify an e-mail-adress - syntax and dns
Christophe wrote: > Steven D'Aprano a écrit : > >>By memory, in an thread about the same topic just a few days ago, Fredrik >>Lundh posted a link to Perl's FAQs that suggests a method for "validating" >>email addresses: treat it like a password and ask the user to type it >>twice. That will protect against simple typos and input errors. > > > I hate that thing. When I see that, I type my email once and copy/paste > into the second edit box. This is useless AND annoying at the same time. Probably safe to say it's a little less useful when the text field contents are visible, but the classic validator for hidden fields. It might surprise you to realise that not everyone in the world is a touch typist, and for them (since they are often looking at the keyboard rather than the screen) it's not an unreasonable validator. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Skype: holdenweb http://holdenweb.blogspot.com Recent Ramblings http://del.icio.us/steve.holden -- http://mail.python.org/mailman/listinfo/python-list