Finding whats in standard modules

Python comes with a library of standard modules. Many of these modules are covered in Part IV and elsewhere in this book.

Tip If you want to find out the gory details about any of the standard modules that we don't cover, see the Python Library Reference at (it's usually also included when you install Python; instructions for installing Python documentation are in Appendix A).

The built-in function dir() returns a sorted list of the names a module defines. To use it, type dir followed by the module name in parentheses, like this:

To get help on a named item in a module, type help; then type (in parentheses) the module name, a dot, and the item name. For example:

>>> help(modulename.functionname)

Was this article helpful?

0 0

Post a comment