Tim Chase wrote:
<snip>

(as an aside, is there a way to get a local/global variable from a string like one can fetch a variable from a class/object with getattr()? Something like getattr(magic_namespace_here, "hello") used in the above context? I know it can be done with eval(), but that's generally considered unsafe unless you vet your input thoroughly)


I think you're looking for
    globals()["hello"],    or of course magic_namespace=globals()

DaveA

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to