28 May
2001
28 May
'01
9:38 a.m.
Hi, How can we in the python script check if the a certain variable exists in the namespace? ie. We can get the value of a variable by using context.myvar or context['myvar'], but both will return an error when the myvar doesn't exists. Now, how can you check if it exists? I tried several things, like context.hasattr('myvar') or context.has_key('myvar') , _hasattr(), _.hasattr() ... etc, but none seem to work. Can somebody tell me if it even is possible? Thanks. Tom.