Channels ▼

Jolt Awards: The Best Books

, September 23, 2014 The best books of the past 12 months.
  • E-mail
  • Print

Jolt Award: Python in Practice

by Mark Summerfield

Mark Summerfield's Python in Practice is a fascinating book intended for intermediate and advanced Python developers. Rather than being a primer, it attacks advanced issues in Python — the ones that go beyond bread-and-butter programming. It imparts the skills that distinguish the expert from the journeyman. In other words, if you're a decent, but not yet great Python programmer, this is book is for you.

The first three chapters are a Python perspective on the Gang of Four (GoF) design patterns. In a dynamic language like Python, many of the problems the original design patterns aimed to solve look different or have a different subtext. Unlike the familiar, long-winded academic presentation of patterns, The author uses practical illustrations to explain the patterns' implementations in Python. The explanations are "what you need to know" and the code examples are concise and sufficient to illustrate the specific point Summerfield is making without spilling into tangentially related side arguments. This combination makes the patterns both more approachable and more likely to be used.

There follows an excellent chapter on concurrency, which discusses I/O versus CPU-bound concurrency and multithreading versus multiprocessing, including explanation of the famous Global Interpreter Lock (GIL).

A chapter on extending Python deals with one of Python's ostensible weaknesses — its slow performance. The book presents multiple solutions for compiling Python to native code and calling C and C++ libraries directly. It drills deeply into the built-in ctypes module and Cython.

My one disappointment is the chapter on high-level networking. It focuses on remote procedure calls (RPCs) — which represent an approach that has lost much of its appeal in recent years. Instead, I would have liked to see a chapter on low-level, socket-based programming and high-level REST/HTTP-based programming with proper Web API design.

The chapter on GUI programming is very good. The author presents the various options, discusses cross-platform concerns, and explains which projects/tools are active. This is important because choosing a GUI toolkit for a UI-intensive application is a decision you will typically have to live with for a long time. The author's experience in this area (he wrote the definitive book on Qt programming) serves him well. He goes on to demonstrate basic techniques, dialogs, and even a full game using Tkinter, the built-in cross-platform GUI toolkit that comes with Python.

The final chapter of the book further extends UI coverage by exploring 3D programming with OpenGL. Two different libraries are used: PyOpenGL and Pyglet.

Overall, the book has the right mix of high-level concepts, low-level details, and code samples. Its pragmatic treatment of useful topics, lucid explanations, succinct code, and careful attention to presentation make it an excellent book for intermediate to advanced Python developers and the Jolt Award winner for 2014.

— Gigi Sayfan

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.