Channels ▼

Mike Riley

Dr. Dobb's Bloggers

Programming Python, 4th Edition Review

February 07, 2011

I have had the pleasure of reading author Mark Lutz's work for nearly 15 years, starting with his first edition of Programming Python way back in 1996. Since then, Python has grown from a Perl alternative to a language capable of running some of the most sophisticated and flexible applications for global companies like Google. How does this 4th release hold up to the previous books it was built upon? Read on to find out.This latest edition begins with a quick summary of what it has been built upon as well as the bold assertion that it only focuses on Python 3 (specifically 3.1, though the code examples work with the latest 3.2 release as well), leaving the Python 1.x and 2.x legacies behind. For those developers not yet ready to make a break for the 3.x world, stick with the 3rd edition.

The book is divided into six parts, starting with the aptly named Part 1. The Beginning. It's also the shortest part of the book, just over 65 pages long, giving a grand overview of the book's contents. Part 2, System Programming, explores system tools (the os and sys modules), script execution context, file tools and threads. The third part focuses a large portion of the book on GUI programming via the Tk/tkinter framework. Part 4 covers Internet programming from the socket level and various libraries (FTP, Email, HTTP and NNTP) to server-side scripting via raw CGI as opposed to spending much time with purpose-built web frameworks like Turbogears and Django. Part 5 delves into tools and techniques, covering databases via pickled objects, ZODB OODB, SQL and ORMs as well as data structures (sets, search trees, sorting, etc.), text and language via string methods, regular expressions and HTML/XML parsing. A chapter covering the Python/C and C++ connection via the SWIG integration code generator also includes a section on embedding python in C and the issues that need to be considered when doing so. The book concludes with its sixth and final section called, appropriately enough, The End. And for those who have spent the time reading the preceding 1,500 pages of the book, Mark shares the meaning of life (keeping in character of paying homage to Python's fixation with all things Monty Python). I also appreciated his brief statement that "something's wrong with the way we program computers," and the wonderful "Gilligan Factor". Indeed, reading the book's final chapter was a nice reward coupled with some especially insightful commentaries on the current state of application development in general.

Even with the emphasis on Python 3, the book continues to clock in at over 1,600 information-packed pages, leaving no standard Python library or related technology unturned. Considering that the previous edition was roughly the same page count, the exclusion of older, deprecated Python explorations is significant. Also making its appearance for the first time in the book is the recognition of Django and Jython; however, Mark smartly abdicates any deep discussion of these technologies to other books. They merely make a limited appearance as a way to recognize their contributions to the Python ecosystem.

For those interested in having a solid foundation Python and are untethered by the past, this edition is a must-have title on your technical bookshelf. For those experienced Pythonistas who own previous editions and are ready to either move their legacy code forward into the new Python 3 practices, Mark shows the way. Given the significant differences between the 3.x and older versions of Python, there remain enough similarities that a large majority of Mark's code has made the jump to this latest edition. And while he continues to rely on Tk for his Python GUI foundation of choice (a good one considering that many others have yet to fully support Python 3.x), the examples are timeless and do the job of advertising the powerful punch that Python provides even after all these years.

Title: Programming Python, 4th Edition Author: Mark Lutz Publisher: O'Reilly Media ISBN: 978-1-4493-0183-5 Pages: 1,632 Price: $51.99 (Ebook), $64.99 (Print)

Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.
 


Video