try:
 myVariable
except NameError:
 print "Not bound"
else:
 print "Bound"

If you want to distinguish between the local an the global environment:

if globals().has_key( "myVariable" ):
 ...

versus

if locals().has_key( ".....


HTH, Gerald

fabian schrieb:
how testing if a variable exists in python as isset in php??

thanks

-- GPG-Key: http://keyserver.veridis.com:11371/search?q=0xA140D634

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to