getattr() in default namespace.

SimonVC python at simon.vc
Fri Apr 9 06:54:46 EDT 2004


That worked nicely. Cheers Carl. (and everyone else who replied.)


>  >>> a = 1
>  >>> namespace = __import__(__name__)
>  >>> getattr(namespace,'a')
>  1



More information about the Python-list mailing list