Tobiah wrote: > Can I do: > > getattr(current_module, 'foo') > > where 'current_module' is a handle the the one > that the code is in? Just like > > getattr(self, 'foo') > > in a class, but for the current module instead?
You can try __import__() with __name__::
>>> foo = 42
>>> mod = __import__(__name__)
>>> getattr(mod, 'foo')
42
STeVe
--
http://mail.python.org/mailman/listinfo/python-list
