[Tutor] Listing imported modules

Tim Johnson tim at johnsons-web.com
Sat Sep 13 02:42:19 CEST 2008


If I execute the following code:
imported = sys.modules.keys()
print imported

Do I indeed get a list of _all_ modules imported by this module?
If so, then could anyone offer suggestion on how to "parse" the
non-standard modules from this list. I.E. modules _not_ included in
the standard python distribution.

I can get a list of what appears to be all modules by starting the
python interperter, invoke help() and then modules <enter>, but
I'm looking for some way to do it programmatically.

Using  Python 2.5.1 on ubuntu 7.10
thanks
tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20080912/310205b3/attachment.htm>


More information about the Tutor mailing list