Re: questions concerning cgi.FieldStorage(keep_blank_values=1)

2005-02-20 Thread Daniel Lichtenberger
Jonas Meurer wrote: "key1" isn't a valid parameter, to supply an empty key you would write script.py?key1=&key2=foo Then cgi.FieldStorage also includes key1. great, it works. but is there no way to use single keywords as GET argument? You could manually parse the request string (CGI stores the requ

Re: Moving to Python from PHP - 3 questions

2005-02-20 Thread Joe Francia
Michal Migurski wrote: Thank you. My impression of Zope in the past has been that it does what I need, along with 10,000 other things I don't (built in WebDAV server?!), but clearly I owe it another chance. I've been initially attracted to mod_python because of its raw simplicity and its apparen

Re: [ANN] Python 2.4 Quick Reference available

2005-02-20 Thread Peter Hansen
Michael Hoffman wrote: That said, I still use file() instead of open(). I think that: for line in file("mytext.txt"): makes a lot more sense than: for line in open("mytext.txt"): I guess it's because the first option sounds a lot more like English. Call me a space-waster (or a "waste of space" ;-)

Re: [ANN] Python 2.4 Quick Reference available

2005-02-20 Thread Michael Hoffman
François Pinard wrote: [Michael Hoffman] To be honest I doubt open will be extended in this manner. I did not read Guido's arguments for a while, so I may remember them wrongly. No, I think you remember them the same way I do. So, take me with a grain of salt. I would not think Guido is arguing fo

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-20 Thread Neil Hodgson
Martin v. Löwis: > So I have to guess what you could have meant. If you want > to be understood, you might have phrased the question like > this: > > "Should I take answers from people which do not respect coherence > of writings serious?" The main grammatical problem with the question is the

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-20 Thread Nick Vargish
Ilias Lazaridis <[EMAIL PROTECTED]> writes: > Now it's really time to close this thread. I suspect this will fall of deaf ears, but I have to mention that you do not get to "close threads" on Usenet. You can excuse yourself from this one and stop replying to comments, but you don't get to unilate

Re: Pausing a program - poll/sleep/threads?

2005-02-20 Thread Simon John
Ah yes, that Informit article helped endlessly - I'm all done now - got the backend to fetch the info from the server every 2secs using a QThread, then it pass the data back to the GUI frontend by raising a custom event! Thanks for all the help folks, now I'm off to compile the new PyQt 3.14 ;-)

Re: Bug in email package?

2005-02-20 Thread Erik Max Francis
Roman Suzi wrote: I think that if any object (from standard library at least) doesn't support iteration, it should clearly state so. My guess is that 'for' causes the use of 'm[0]', which is (rightfully) an error... Can this behaviour of email be considered a bug? Is there a good case to iterate

Re: exercise: partition a list by equivalence

2005-02-20 Thread Erik Max Francis
John Machin wrote: Xah is asserting his right to be recognised as the author of his artistic creations, line by line. Not very well, however, since his usage doesn't constitute a valid copyright notice :-). -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA

Tuple index

2005-02-20 Thread Steve M
Hello, I'm trying to figure out the index position of a tuple member. I know the member name, but I need to know the members index position. I know that if I use the statement print tuple[4] that it will print the contents of that location. What I don't understand is if I know that foo is

Re: Tuple index

2005-02-20 Thread Larry Bates
Tuples don't have all the nice methods that lists have so convert it to a list. tuple=('a','b','c','d') l=list(tuple) now you can do: list.index('c') which returns 2 Remember index returns -1 when nothing is found. Larry Bates Steve M wrote: > Hello, > > I'm trying to figure out th

Re: Bug in email package?

2005-02-20 Thread Steven Bethard
Erik Max Francis wrote: Roman Suzi wrote: I think that if any object (from standard library at least) doesn't support iteration, it should clearly state so. My guess is that 'for' causes the use of 'm[0]', which is (rightfully) an error... Can this behaviour of email be considered a bug? Is the

Re: Tuple index

2005-02-20 Thread Erik Max Francis
Larry Bates wrote: Tuples don't have all the nice methods that lists have so convert it to a list. tuple=('a','b','c','d') l=list(tuple) now you can do: list.index('c') which returns 2 Remember index returns -1 when nothing is found. No, that's .find in strings that returns -1. .index in lists rai

Re: - E02 - Support for MinGW Open Source Compiler

2005-02-20 Thread Mark Lawrence
Nick Vargish wrote: > "BrainDead" <[EMAIL PROTECTED]> writes: > > > I believe that you are wasting your time. Looking at your email > > address, this may well be relevant. > [ 4-line URL snipped ] > > Thanks for the historical reference. Please consider a visit to > tinyurl.com before posting a

Re: recommended way of generating HTML from Python

2005-02-20 Thread has
xtian wrote: > Stan (part of nevow, which is part of twisted) is a nice python syntax > for building HTML [...] > I don't know how detachable it is from the rest of nevow. I'd assume it > wouldn't be too difficult to implement in a standalone fashion. FWIW I whipped up a simple self-contained Stan

Re: Tuple index

2005-02-20 Thread John Machin
Steve M wrote: > Hello, > > I'm trying to figure out the index position of a tuple member. > I know the member name, but I need to know the members index position. Tuples, like lists, don't have members in the sense that they can be "named" like t.foo. The only way of referring to them is

Re: How Do I get Know What Attributes/Functions In A Class?

2005-02-20 Thread steven
Thank you Hans. Could you give me a simple sample of using inspect? -- http://mail.python.org/mailman/listinfo/python-list

Re: low-end persistence strategies?

2005-02-20 Thread Paul Rubin
"Michele Simionato" <[EMAIL PROTECTED]> writes: > Ok, I have yet another question: what is the difference between > fcntl.lockf and fcntl.flock? The man page of my Linux system says > that flock is implemented independently of fcntl, however it does > not say if I should use it in preference over f

Re: How Do I get Know What Attributes/Functions In A Class?

2005-02-20 Thread George Sakkis
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Thank you Hans. Could you give me a simple sample of using inspect? > http://www.python.org/doc/current/lib/module-inspect.html George -- http://mail.python.org/mailman/listinfo/python-list

PyEphem on Win32

2005-02-20 Thread David Flory
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Has anyone run the PyEphem ephemeris application under WinXP? I have compiled it with Visual Studio 6 and it crashes Python with a simple >>> import ephem >>> ephem.date('1994/7/16') Identical code works fine under Linux. I am running ActivePyth

Re: help please

2005-02-20 Thread gargonx
Even if i put it in exactly the way you did: >>> import re >>> charmatcher = re.compile(r' [A-Z] [\d]?') >>> >>> ext = dict(D="V1", O="M1", G="S1") >>> std = dict(S="H") >>> >>> decode_replacements ={} >>> decode_replacements.update([(std[key], key) for key in std]) Traceback (most recent call las

Python/Rexx Interface Now Available

2005-02-20 Thread les
A Python Rexx Interface is now available to allow Python scripting to access REXX libraries and utilities. See http://www.lestec.com.au for details Regards, Les -- http://mail.python.org/mailman/listinfo/python-list

Re: intersection of 2 list of pairs

2005-02-20 Thread James Stroud
Learned list comprehension today, its cool: >>> E1=[('a','g'),('r','s')] >>> E2=[('g','a'),('r','q'),('f','h')] >>> [x for x in E1 for y in E2 if x == y or (x[1],x[0])==y] [('a', 'g')] On Sunday 20 February 2005 09:24 am, [EMAIL PROTECTED] wrote: > Hi, > I have 2 lists of tuples that look lik

python2.4 generator expression > python2.3 list expression

2005-02-20 Thread snacktime
I need to convert a generator expression to a list expression so it will work under python 2.3. I rewrote this: for c in range(128): even_odd = (sum(bool(c & 1

Re: lambda closure question

2005-02-20 Thread Mike Meyer
"Carl Banks" <[EMAIL PROTECTED]> writes: > Say you have a suite of functions, all of which are called by some main > function and each other, and all of which need to access a lot of the > same data. The best, most straightforward way to do it is to have the > common data be a local variable of t

Re: help please

2005-02-20 Thread Steven Bethard
gargonx wrote: Even if i put it in exactly the way you did: import re charmatcher = re.compile(r' [A-Z] [\d]?') ext = dict(D="V1", O="M1", G="S1") std = dict(S="H") decode_replacements ={} decode_replacements.update([(std[key], key) for key in std]) Traceback (most recent call last): File "", lin

Re: python2.4 generator expression > python2.3 list expression

2005-02-20 Thread Steven Bethard
snacktime wrote: I need to convert a generator expression to a list expression so it will work under python 2.3. I rewrote this: for c in range(128): even_odd = (sum(bool(c & 1< As this: for c in range(128): bo = [bool(c & 1< Seems to work, is there a better way to do this? Well, if you were ha

IDLE Problem: win98\Python2.4

2005-02-20 Thread kim kubik
This sure seems like it would have been brought up but I checked Google Groups (the dejanews replacement) and saw nothing: I installed Python2.4 in Win98 and IDLE doesn't work (neither does the online manual even tho a 3.6KB Python24.chm is there, but that's a story for another day) - that is, cli

Re: unicode encoding usablilty problem

2005-02-20 Thread aurora
On Sat, 19 Feb 2005 18:44:27 +0100, Fredrik Lundh <[EMAIL PROTECTED]> wrote: "aurora" <[EMAIL PROTECTED]> wrote: I don't want to mix them. But how could I find them? How do I know this statement can be potential problem if a==b: where a and b can be instantiated individually far away from

Re: [Fwd: Re: [Uuu-devel] languages] <-- Why Python

2005-02-20 Thread Mike Meyer
Nick Coghlan <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> Arich Chanachai <[EMAIL PROTECTED]> writes: >> >>>Mike Meyer wrote: >>> Whatever the intentions may be, the *act* is one of dictation. Since the point of the underlying OS is to increase the interconnections between applic

Re: help please

2005-02-20 Thread Steven Bethard
Dennis Lee Bieber wrote: On 20 Feb 2005 20:12:50 -0800, "gargonx" <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: decode_replacements.update([(std[key], key) for key in std]) Traceback (most recent call last): File "", line 1, in ? AttributeError: keys Did you read the reference

Re: questions concerning cgi.FieldStorage(keep_blank_values=1)

2005-02-20 Thread Michele Simionato
Jonas: > in this application, i need keys to be delivered with the url, some with > and some without value (for example 'script.py?key1&key2=foo'. You are missing an "=" sign after key1. Confront with this example: from cgi import parse_qsl QS = "x=1&y=2&x=3&z=&y=4" print parse_qsl(QS) print par

Re: recommended way of generating HTML from Python

2005-02-20 Thread Michele Simionato
The problem is a problem of standardization, indeed. There plenty of recipes to do the same job, I just would like to use a blessed one (I am teaching a Python course and I do not know what to recommend to my students). FWIW, here is a my version of the recipe (stripped down to the bare essentials

Re: [Fwd: Re: [Uuu-devel] languages] <-- Why Python

2005-02-20 Thread Mike Meyer
[EMAIL PROTECTED] (Paul Boddie) writes: > Mike Meyer <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... >> Arich Chanachai <[EMAIL PROTECTED]> writes: >> >> > When the CLR is integrated, it will allow a wide array of problem >> > solving choices for uuu users. >> >> You've missed t

Re: Article on Hi-Fi Myths

2005-02-20 Thread Mike Meyer
Al Christians <[EMAIL PROTECTED]> writes: > I learned Friday night that the hi-fi talk is our most popular tape. > This page: > > http://www.belt.demon.co.uk/product/Cable_Controversy/Cable_Controversy.htm > > Gives a somewhat different take on the controversy, almost certainly > bizarre. It's a

Re: Bug in email package?

2005-02-20 Thread Tim Roberts
Roman Suzi <[EMAIL PROTECTED]> wrote: > >I was playing with email package and discovrered this strange kind of >behaviour: > import email.Message m = email.Message.Message() m['a'] = '123' print m >>From nobody Mon Feb 21 00:12:27 2005 >a: 123 > for i in m: print i >... >T

Re: unicode encoding usablilty problem

2005-02-20 Thread aurora
On Sun, 20 Feb 2005 15:01:09 +0100, Martin v. Löwis <[EMAIL PROTECTED]> wrote: Nick Coghlan wrote: Having "", u"", and r"" be immutable, while b"" was mutable would seem rather inconsistent. Yes. However, this inconsistency might be desirable. It would, of course, mean that the literal canno

Re: Moving to Python from PHP - 3 questions

2005-02-20 Thread Michal Migurski
Thank you. My impression of Zope in the past has been that it does what I need, along with 10,000 other things I don't (built in WebDAV server?!), but clearly I owe it another chance. I've been initially attracted to mod_python because of its raw simplicity and its apparent similarity to mod_ph

Re: python2.4 generator expression > python2.3 list expression

2005-02-20 Thread Michael Hoffman
snacktime wrote: I need to convert a generator expression to a list expression so it will work under python 2.3. I rewrote this: for c in range(128): even_odd = (sum(bool(c & 1< As this: for c in range(128): bo = [bool(c & 1< Seems to work, is there a better way to do this? If you want to keep

<    1   2