A sample chapter is available free from InformIT—click "Sample Content" and then "Download the sample pages".
This book teaches you how to write programs using Python 3, the most up to date, powerful and flexible version of Python yet released. Python 3 introduces many new idioms compared with Python 2 that make programming with it easier and at the same time helps produce clearer and more maintainable code. Python 3 is a superb very high level language, that is very easy to learn and use even by relatively inexperienced programmers. And once learned, Python 3 does not impose limits or restrictions, instead offering incredibly powerful and advanced facilities for those who want to learn and use them. Python runs on Windows and most Unix-like operating systems such as Mac OS X, BSD, and Linux.
The book focuses exclusively on Python 3 to avoid the risk of confusion with earlier versions. However, existing Python 2 programmers might find my highly condensed Moving from Python 2 to Python 3 document (4 pages, PDF, 676K) to be a helpful companion.
The book is 648 pages, and is published by
Previews are available from
the Introduction, all of Chapter 13 (Regular
Expressions), and the index is available from
(click the Sample Content tab and then the Download the sample
The book can be bought from Amazon.com, Amazon.co.uk, and other online and local book stores.
Only the printed editions are definitive—although available in electronic formats, "ebooks" usually restrict your rights, and they are often retypeset which can introduce errors. A legal PDF version is available from InformIT. Translations are arranged by the publisher and their quality can vary considerably.
This second edition has been fully revised and updated to cover both Python 3.0 and Python 3.1 (and is useful for all Python 3.x versions), and extended with new chapters on debugging, testing, and profiling, and on parsing (with coverage of the third party PyParsing and PLY modules), as well as a new section on coroutines in the Advanced chapter. After mastering this book, read Python in Practice to progress further.
The source code is available in two formats, py3book30.tar.gz (293K suitable for any platform), and py3book30.zip (403K Windows line endings) [updated 2013-07-26]—all the examples and code snippets have been tested with Python 3.0, 3.1, 3.2, 3.3, and 3.4. If you don't care about Python 3.0-compatibility, then you might prefer the Python 3.1+ versions of the examples: py3book31.tar.gz (293K suitable for any platform), and py3book31.zip (403K Windows line endings) [updated 2014-03-23]. There is also an Errata [updated 2015-06-11].
See also my Python Programming Tips.
For more information on Python 3 see the Python website.
Like all my books and most of my other writings, this book was written using The Lout Typesetting System.