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