0

What modules come builtin with your Python? Let's exclude the internal _ starting ones for this question. You know those? Are you sure? Good, because I did not!

(Hint WindowsXP and Python2.72 has 27 builtin modules)

Here the answer in code

import sys
print('\n'.join(n for n in sys.builtin_module_names if not n.startswith('_')))

help(module_name) could be handy after this. Or looking from builtin help. I sure was curious to check the audioop.

Edited by pyTony: n/a

2
Contributors
2
Replies
4
Views
5 Years
Discussion Span
Last Post by Gribouillis
0

What modules come builtin with your Python? Let's exclude the internal _ starting ones for this question. You know those? Are you sure? Good, because I did not!

(Hint WindowsXP and Python2.72 has 27 builtin modules)

Here the answer in code

import sys
print('\n'.join(n for n in sys.builtin_module_names if not n.startswith('_')))

help(module_name) could be handy after this. Or looking from builtin help. I sure was curious to check the audioop.

Sorry, they are 29 for Python 2.72.

import sys
print('\n'.join('%i: %s' % (ind, n)
                for ind, n in enumerate(
                    (s for s in sys.builtin_module_names
                     if not s.startswith('_')), 1)
                )
      )

Edited by pyTony: n/a

1

An alternative way to explore your modules is to start a pydoc server and visit it with your web browser. Here is how it goes in linux

$ pydoc -p 9999&
[1] 7877
$ pydoc server ready at http://localhost:9999/

It shows hundreds of modules for me to explore :)

Note that pydoc has a limitation: it must import a module first to show the module's doc. This could be annoying for certain modules.

Edited by Gribouillis: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.