How to get the list of imported variables/functions

Michael Hudson mwh21 at cam.ac.uk
Tue May 2 11:17:13 EDT 2000


<abouf066 at aix2.uottawa.ca> writes:

> Greetings, 
> 
> 	Is there a way to know what variables/functions were imported
> from a given module after : 
> 
> 
> 	from blah_blah import *
> 
> Thanks for your time and help

Not directly, but something like:

filter(lambda x:not x.startswith("_"),sys.modules['blah_blah'].keys())

should do the trick.

Cheers,
M.

-- 
  nonono,  while we're making wild  conjectures about the behavior 
  of completely  irrelevant tasks,  we must not  also make serious 
  mistakes, or the data might suddenly become statistically valid.
                                      -- Erik Naggum, comp.lang.lisp



More information about the Python-list mailing list