From: Christopher S. <che...@ya...> - 2003-04-10 10:48:45
|
I've got another silly python question: How can I check to see if a variable exists? I thought I could do something like: if var['field']: do some stuff But that fails at runtime, telling me that var['field'] is not defined! In PHP, there are empty() and isset() functions that will allow me to test for variable existance. Is there anything like that in Python? I looked in the library reference, but didn't see anything. Thanks, Chris __________________________________________________ Do you Yahoo!? Yahoo! Tax Center - File online, calculators, forms, and more http://tax.yahoo.com |