10 Python Documentation and Books

10.1 Books

At the beginning of 1999 there was little to choose from in the way of Python books. There were really only two English language books and neither was an ideal introduction to the language. Two years later the situation is quite different. Numerous books have been published and more are on the way. We will only mention some of the available books here. Those wishing to see the whole list should visit the Python web site ``bookstore''.

Currently we feel that the following two books are the best introductions to Python:

Do not confuse Learning Python with Programming in Python by Lutz (also an O'Reilly book) which is older and much longer. In our view, the older book is poorly organized and not very convenient to use.

The standard Python documentation may also be purchased as bound books (but is available for free online in html, postscript or pdf form). Check the PSA bookstore link provided above to see how to order the hardcopy versions.

People may find the following books useful:

10.2 Online Documentation

The Standard Python Distribution is generally documented quite well. The documentation may be obtained from in various formats. Available are the following:

Document  Comment 
Tutorial Introduction to Python
Library Reference Essential reference
Language Reference Should not be needed by most
Extending and Embedding For those interested in accessing C or C++ code from Python, or Python from C or C++.
Python/C API More information on the Python/C interface.

There are also a number of Topic guides and How-to's available. Those making extensive use of regular expressions may find Mastering Regular Expressions by Friedl (O'Reilly, ISBN: 1-5659-2257-3) useful, though its references to Python regular expressions are now obsolete (Python regular expressions now behave much more like those of Perl).

Tkinter is currently the most widely used GUI toolkit library available for Python, and there is now a good book that describes how to use it: Python and Tkinter Programming by Grayson, published by Manning (ISBN: 1-8847-7781-3). There is also on-line documentation by Fredrik Lundh available, though it is not as complete as the book. Most will also benefit from Tk documentation or books (particularly Practical Programming in Tcl and Tk by Welch).

wxPython is another cross-platform GUI library that is gaining momentum. Although a book is in the works, it will not be available until next year. See the wxPython web site for details.

Numeric, the module that provides arrays for efficient numerical programming, is not part of the standard distribution, but we expect to use it heavily in the future. PyRAF already makes use of Numeric for some array conversion functions. The current documentation for Numeric may be found at Our rewrite of Numeric, numarray, is available at, and our Python FITS module pyfits is available at

Questions or comments? Contact
Documented updated on 2004 Jun 1