Python 2.6 Global Variables

AK Eric warpcat at sbcglobal.net
Thu Oct 29 18:31:03 CET 2009


> 2/ in Python, "global" really means "module-level" - there's nothing
> like a "true" global namespace.

Isn't that __main__?


import __main__
__main__.foo = "asdfasdf"

print foo
# asdfasdf

Not advocating, but it does serve the purpose.



More information about the Python-list mailing list