O'Reilly logo

Python: Essential Reference, Third Edition by David Beazley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 11. Introduction to the Python Standard Library

PYTHON IS BUNDLED WITH A LARGE COLLECTION of modules collectively known as the Python library. Library modules are used simply via an import statement. For example:

import socket

Automatically generated documentation, collected from documentation strings and source code, can be obtained using the pydoc command (executed as a shell command) or the help() command if running interactively in the Python interpreter. For example:

>>> help(re) Help on module re: NAME re - Minimal "re" compatibility wrapper. See "sre" for documentation. FILE /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/re.py MODULE DOCS http://www.python.org/doc/current/lib/module-re.html CLASSES exceptions.Exception ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required