# globals() does for the global (module) namespace. if __name__ == "__main__": for k, v in globals().items(): print k, "=", v