Test the existence of a variable?

Thierry S. thierry.s at free.fr
Fri Sep 3 06:37:29 EDT 2004


Hello.

I would to test the existence of a variable before to use it (like
isset($myVar) in PHP).
I try using "if myVar: ", but there is the error meesage (naturally):
"NameError: name 'myVar' is not defined"

Please, could you tell me what for function exist to test the variable with
Python?

Regards,
-- 
Thierry S.



More information about the Python-list mailing list