The Most Important Python Docs

On this page you will find links to the most important pages of the Python docs. When you start programming in Python, you'll find these to be extremely useful. I look at these quite often. :-)

Important: These links are for reference only. It is assumed that you are already somewhat familiar with the Python language, i.e. you should at least have read the Python tutorial.

Note: These links point to the docs of the most recent version of Python, which might not be the version that you have. Therefore, there might be features described which are not available to you. If in doubt, upgrade to the latest official stable version of Python.

This table (at the bottom of the page) lists all of Python's built-in operators in the order of precedence, from lowest (least binding) to highest (most binding).
Special Method Names
This is a description of special method names that can be used to implement so-called protocols for classes, so that the objects can be used to perform like certain other types. In particular, they can be used to give certain functionality to standard operators when used with objects of this class (i.e. operator overloading).
Built-in Functions
Description of all of Python's built-in functions. You'll use this page a lot, believe me. :-)
String Methods
Description of all string methods, i.e. nifty things that you can apply to strings, like splitting, searching etc.
String Formatting
Description of the string formatting operations that you can do with the "%" operator (similar to what you can do with "printf" in C).
List Methods
This page lists operations and methods that can be applied to lists (or to other mutable sequences, but not to immutable sequences such as tuples).
Dictionary Methods
This page lists operations and methods that can be applied to dictionaries (or to other mapping objects). In other languages, those are called associative arrays or hashes.
File Objects
Description of file objects: How to create them, how to use them, a list of the various methods and attributes that they support.
Built-in Exceptions
This page describes all built-in exceptions and also shows their class hierachy (at the bottom of the page).
The "sys" Module
Description of all functions and variables in the "sys" module. You will probably almost always import it, because it contains things like argv[], exit() and stderr.
Regular Expressions
Description of the "re" module for using regular expressions. It contains several subsections, most importantly RE Syntax, Module Functions, RE Objects and Match Objects. There's also a nice explanation how to simulate "scanf()" using regular expressions on the Examples subsection.
The "os" Module
Descriptions of all functions in the "os" module. It contains many of the things that you usually get from the libc, such as file and directory operations, handling processes, environment variables etc.
The "os.path" Module
Descriptions of all functions in the "os.path" module. It contains such useful things like basename(), exists() and realpath(), just to name a few.
The "time" Module
Descriptions of all functions in the "time" module for handling and converting time and date specifications.
The "getopt" Module
This module can be used to easily parse command line options, very similar to getopt() in C. It also supports GNU-style long options. However, there's another module called optparse which is much more powerful, but also more complex.
The "glob" Module
This module performs so-called "globbing", i.e. shell-style pathname pattern expansion. It supports the standard shell wildcards ("*, "?" and "[]").
The "shutil" Module
The "shutil" module can be used for several high-level file operations, such as copying and moving single files or whole directory trees.
The "commands" Module
This module is useful for running external commands (such as "/sbin/ifconfig -a") and capturing their output.

There are many, many more modules than the ones listed above. There are modules for debugging and profiling, automated documentation and regression testing, signal processing, socket I/O, threading, various internet protocols, writing CGI programs, parsing and producing various formats (including HTML and XML), handling of multimedia data, accessing databases, compression, encryption, textual user interfaces ( la curses) and even graphical user interfaces that can be made portable so they run under X11 as well as under MacOS and Windows. And lots more.

For an overview and extensive descriptions of all modules that come with the default Python distribution, refer to the Python Library Reference.

[HTML 4.01]