[Zope] Simple Python question

Ed Leafe ed@leafe.com
Wed, 24 Jul 2002 09:09:55 -0400


<alert type="newbie">

	How do I test if a value exists in Python? I'd really like to avoid 
using try/except if possible. I need to do something like:

if defined(x):
	print 'x is cool'
else:
	print 'x does not exist'

</alert>

      ___/
     /
    __/
   /
  ____/
  Ed Leafe
  http://leafe.com/
  http://foxcentral.net