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
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!