Re: [Tutor] How to verify all things are equal to one another

2005-05-15 Thread jfouhy
Quoting Terry Carroll <[EMAIL PROTECTED]>: > Suppose I have several variables, e.g.: a, b, c, d, e, f, g. > > I would like to be able to see if they're all the same, I don't care > what the value is, as long as they're equal. If they're all equal to 0, or > to "spam", or to ["cleese", "idle", "gi

Re: [Tutor] How to verify all things are equal to one another

2005-05-15 Thread Max Noel
On May 15, 2005, at 06:54, Terry Carroll wrote: > if (a == b & > a == c & > a == d & > a == e & > a == f & > a == g): > do stuff > Well, you can already try this: if a == b == c == d == e == f == g: do stuff -- Max maxnoel_fr at yahoo dot fr -- ICQ #85274019 "

Re: [Tutor] How to verify all things are equal to one another

2005-05-15 Thread Alan G
> Is there a more pythonic way of doing this other than, > > if (a == b & > a == c & > a == d & > a == e & > a == f & > a == g): > do stuff You don't want to use & coz its a bitwise comparison, so you should use 'and' if a == b and a == c and ... However you

Re: [Tutor] Pipe variable to external command (solved)

2005-05-15 Thread Jeffrey Rice
At 04:17 PM 5/13/2005, Alan Gauld wrote: >AS a general pont all uppercase usually means a consrtant in Python. >Variable names typically start lowercase and either use capital >letters to separate words likeThis, or use underscores like_this. > >Variables starting with an uppercase letter tend to i

Re: [Tutor] How to verify all things are equal to one another

2005-05-15 Thread Danny Yoo
> > Suppose I have several variables, e.g.: a, b, c, d, e, f, g. > > > > I would like to be able to see if they're all the same, I don't care > > what the value is, as long as they're equal. If they're all equal to > > 0, or to "spam", or to ["cleese", "idle", "gilliam"], as long as > > they're the

Re: [Tutor] Why use apply()?

2005-05-15 Thread Danny Yoo
On Thu, 12 May 2005, Bernard Lebel wrote: > Just a generic question: why one would use apply()? > > In Learning Python, on page 357, there is an example of generating an > instance using apply(): > > class A: > def __init__( self, number ): > self.number = number > > a = apply

Re: [Tutor] Pipe variable to external command (solved)

2005-05-15 Thread Danny Yoo
> Here is what the code I settled on looks like: > > ### > working = email.message_from_file(open(emailfile)) > > clamav = popen2.Popen3(clamav_cmd,1) > clamav.tochild.write(working.as_string()) > clamav.tochild.close() > clamav_result = clamav.fromchild.read().lstrip('stream: ') > clamav.fromchi

Re: [Tutor] Pipe variable to external command (solved)

2005-05-15 Thread Jeffrey Rice
At 04:29 PM 5/15/2005, Danny Yoo wrote: > > clamav.fromchild.close > ^^ >Careful: you may need parens there on your 'close' line. (clothesline? >*grin*) > >As written, that last statement doesn't fire off the close() method. >This might be suprising because some other languag