Other Built-in Modules

See the Python library reference manual (available at http://www.python.org) for details on other standard modules available to Python programmers. A partial sampling of commonly-used modules follows.


Interfaces for sending and receiving data over BSD-style sockets (an object with socket call methods).


Support for restricted (trusted/safe) execution mode. Especially useful for Internet-related applications.


Interface to Python’s integration of the Tk GUI API. Used for writing portable graphical interfaces with native look-and-feel on X-Windows, MS-Windows, and Macintosh. Widgets are customizable classes (e.g., Button, Frame), options are keyword arguments, and composition is object embedding (not paths).


Interfaces to UNIX select function. Wait for activity on one of N files or sockets (multiplex).


Interfaces for processing signals in Python programs.

thread, threading

Python’s thread interface (lightweight processes which share global data). Tools to start, stop, synchronize.


Interfaces for parsing and accessing form information in CGI Internet scripts. After a script calls “form = cgi.FieldStorage( ),” form is a dictionary-like object with one entry per form field (form [“name” ].value).

urllib, httplib, HTMLlib

Accessing arbitrary Internet URLs like files, http protocol tools, parsing HTML files.


Interfaces for Internet file transfers in Python programs. After “ftp=ftplib.FTP(‘sitename’),” ftp has methods for login, changing ...

Get Python Pocket Reference now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.