Read an Excerpt
THIS BOOK IS INTENDED TO BE A CONCISE REFERENCE to the Python programming language. Although an experienced programmer will probably be able to learn Python from this book, it's not intended to be an extended tutorial or a treatise on how to program. Rather, the goal is to present the core Python language, the contents of the Python library, and the Python extension API in a manner that's accurate and concise. This book assumes that the reader has prior programming experience with Python or another language such as C or Java. In a addition, a general familiarity with systems programming topics (for example, basic operating system concepts and network programming) may be useful in understanding certain parts of the library reference.
Python is freely available for download at http://www.python.org. Versions are available for almost every operating system, including UNIX, Windows, Macintosh, and Java. In addition, the Python website includes links to documentation, how-to guides, and a wide assortment of third-party software.
The contents of this book are based on Python 2.4. However, readers should be aware that Python is a constantly evolving language. Most of the topics described herein are likely to be applicable to future versions of Python 2.x. In addition, much of the material is applicable to earlier releases. To a lesser extent, the topics in this book also apply to alternative Python implementations such as Jython (an implementation of Python in Java) and IronPython (an implementation of Python for .NET). However, those implementations are not the primary focus.
Just as Python is an evolving language, the third edition ofPython Essential Reference has evolved to make use of new language features and new library modules. In fact, since the publication of the second edition, Python has undergone a dramatic transformation involving significant changes to core parts of the language. In addition, a wide variety of new and interesting features have been added. Rather than discussing these changes as a mere afterthought, the entire text has been updated to reflect the modern state of Python programming. Although no distinction is given to new features, detailed descriptions of language changes can be found at http://www.python.org.
Finally, it should be noted that Python already includes thousands of pages of useful documentation. The contents of this book are largely based on that documentation, but with a number of key differences. First, this reference presents most of the same information in a much more compact form, with different examples, and alternative descriptions of many topics. Second, a significant number of topics in the library reference have been expanded to include outside reference material. This is especially true for low-level system and networking modules in which effective use of a module normally relies on a myriad of options listed in manuals and outside references. In addition, in order to produce a more concise reference, a number of deprecated and relatively obscure library modules have been omitted. Finally, this reference doesn't attempt to cover large frameworks such as Tkinter,
In writing this book, it has been my goal to produce a reference containing virtually everything I have needed to use Python and its large collection of modules. Although this is by no means a gentle introduction to the Python language, I hope that you find the contents of this book to be a useful addition to your programming reference library for many years to come. I welcome your comments.
November 27, 2005
© Copyright Pearson Education. All rights reserved.