Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlug] variable assignments inside expressions in python



Hi,

In C, I can do a variable assignment inside a while expression, like:

while ( (myvar = get_time( ) ) < DEADLINE) {
 /* use the value of myvar somewhere*/
  ...
}

Trying to do the same in python
while ( (myvar = get_time( ) ) < DEADLINE):

throws an error. Is there a "python way" to do this? (I have googled
a little and the answer seems that I can't, but I refuse to accept it
:-) )

Thanks,
Hector


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links