How to build a list of all modules in standard library?

python at bdurham.com python at bdurham.com
Wed Feb 17 09:57:27 EST 2010


We're building a py2exe executable that may need to do some
dynamic module imports.

I'm looking for suggestions on how we can mechanically generate a
list of standard library modules/packages to make sure our build
has the full set of Python 2.6.4 libraries.

We're planning on creating a module called stdlib.py that
explictly imports all modules within an "if False:" block of code
per example below and then importing this script (stdlib.py) in
our main script.

# stdlib.py - insure that py2exe imports all modules in its build

if False:
     # list of all standard modules
     import <module -1>
     ...
     import <module-N>

     # list of 3rd party modules
     import win32api
     import wmi
     ...

Any suggestions or feedback appreciated.

Thanks,
Malcolm
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100217/ad265106/attachment.html>


More information about the Python-list mailing list