Hello:
Please help me to solve this:
>>> def printA():
... try: print a
... except NameError: print 'variable undefined'
...
>>> printA()
variable undefined
>>> a = "foo"
>>> printA()
foo
>>>
I tried to do the same think by importing a file "test.py" which has the function 'printA()'
Content of the file 'test.py'
=================
def printA():
try: print a
except NameError: print 'variable undefined'
>>> from test import *
>>> printA()
variable undefined
>>> a = "foo"
printA()
variable undefined
>>>
Any idea why the variable 'a' is still undefined in this case?