vars() and dir()

Claire claireguilbaud at yahoo.fr
Thu Aug 26 08:48:02 EDT 2004


hi, 
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

Thanks

Claire



More information about the Python-list mailing list