What I\'m trying to do would look like this in the command line:
>>> import mymodule
>>> names = dir(mymodule)
How can I
Just use globals()
globals() — Return a dictionary representing the current global symbol table. This is always the dictionary of the current module (inside a function or method, this is the module where it is defined, not the module from which it is called).
http://docs.python.org/library/functions.html#globals