Books

Books : reviews

David Beazley, Brian K. Jones.
Python Cookbook: 3rd edn.
O'Reilly. 2013

rating : 2.5 : great stuff
review : 29 November 2024

If you need help writing programs in Python 3, or want to update older Python 2 code, this book is just the ticket. Packed with practical recipes written and tested with Python 3.3, this unique cookbook is for experienced Python programmers who want to focus on modern tools and idioms.

Inside, you’ll find complete recipes for more than a dozen topics, covering the core Python language as well as tasks common to a wide variety of application domains. Each recipe contains code samples you can use in your projects right away, along with a discussion about how and why the solution works.

Topics include:

• Data Structures and Algorithms
• Strings and Text
• Numbers, Dates, and Times
• Iterators and Generators
• Files and l/O
• Data Encoding and Processing Functions
• Classes and Objects
• Metaprogramming
• Modules and Packages
• Network and Web Programming
• Concurrency
• Utility Scripting and System Administration
• Testing, Debugging, and Exceptions
• C Extensions

This book highlights features of Python 3 in a series of recipies. It covers all aspects, from relatively simple string and file handling, through the power of iterators and generators, into the more advanced decorators and metaprogramming. Each recipe is stated concisely as a problem (more of a task, really, as it often turns out not to be a problem at all) followed by a solution (surprisingly often: ‘use this library’), then a discussion of some tricky corner cases and more murky depths.

This is not a tutorial: it is assumed the reader is a relatively experienced Python programmer. For parts of the language you know, the recipes provides an excellent solutions. For parts yet to be explored, the recipes provide exciting hints of what is possible, but further reading will be needed. There’s something here for every Python programmer.

David Beazley.
Python Distilled.
O'Reilly. 2013

Expert insight for modern Python (3.6+) development from the author of Python Essential Reference

The richness of modern Python challenges developers at all levels. How can programmers who are new to Python know where to begin without being overwhelmed? How can experienced Python developers know they’re coding in a manner that is clear and effective? How does one make the jump from learning about individual features to thinking in Python at a deeper level? Dave Beazley’s new Python Distilled addresses these and many other real-world issues.

Focusing on Python 3.6 and higher, this concise handbook focuses on the essential core of the language, with updated code examples to illuminate how Python works and how to structure programs that can be more easily explained, tested, and debugged. Throughout, Beazley reflects all he’s learned teaching Python to scientists, engineers, and developers, and pushing the envelope of what makes Python tick.

Rather than trying to cover every possible feature and quirk of a 30-year-old language, this pragmatic guide provides a concise narrative related to fundamental programming topics such as data abstraction, control flow, program structure, functions, objects, and modules—topics that form the foundation for Python projects of any size.

Explore Python’s core, from variables to packages
Solve data manipulation and analysis problems more effectively
Structure programs with an eye towards clarity and reliability
Control objects and master the “protocols” that define their behavior
Master functions and functional programming idioms
Discover the surprising power offered by generators
Understand classes from both high-level and technical perspectives
Plan for project growth by understanding modules and packages
Learn techniques and abstractions for proper I/O handling
Dicts!