vars() and dir()

Claire claireguilbaud at
Thu Aug 26 14:48:02 CEST 2004

i use vars() or dir() to get variables. I use them in a def block, so
i get variables of that block. How can i get variables from the
namespace __main__ ?
I use python in interactive mode and want to have a function to get a
dictionnary for python types (int, ...) and another for my types (my
classes). this function will be in my pythonstartup file.

If i use python in interactive mode, is there a main module defined ?
i don't know how to use namespace __main__ to get information on this
"global namespace" like i can do with math or another module



More information about the Python-list mailing list