- List Price: $59.99
- Save: $39.48 (66%)
- FREE return shipping at the end of the semester.
- Access codes and supplements are not guaranteed with rentals.
Other Sellers on Amazon
+ $3.99 shipping
+ $3.99 shipping
+ Free Shipping
Python Cookbook, Third Edition Paperback – Illustrated, June 4, 2013
|New from||Used from|
The Amazon Book Review
Book recommendations, author interviews, editors' picks, and more. Read it now
Enter your mobile number or email address below and we'll send you a link to download the free Kindle App. Then you can start reading Kindle books on your smartphone, tablet, or computer - no Kindle device required.
To get the free app, enter your mobile phone number.
Frequently bought together
From the Publisher
From the Preface
Rather than attempting to seek out Python 3-specific recipes, the topics of this book are merely inspired by existing code and techniques. Using these ideas as a springboard, the writing is an original work that has been deliberately written with the most modern Python programming techniques possible. Thus, it can serve as a reference for anyone who wants to write their code in a modern style.
In choosing which recipes to include, there is a certain realization that it is simply impossible to write a book that covers every possible thing that someone might do with Python. Thus, a priority has been given to topics that focus on the core Python language as well as tasks that are common to a wide variety of application domains. In addition, many of the recipes aim to illustrate features that are new to Python 3 and more likely to be unknown to even experienced programmers using older versions.
There is also a certain preference to recipes that illustrate a generally applicable programming technique (i.e., programming patterns) as opposed to those that narrowly try to address a very specific practical problem. Although certain third-party packages get coverage, a majority of the recipes focus on the core language and standard library.
Who This Book Is For
This book is aimed at more experienced Python programmers who are looking to deepen their understanding of the language and modern programming idioms. Much of the material focuses on some of the more advanced techniques used by libraries, frameworks, and applications.
Throughout the book, the recipes generally assume that the reader already has the necessary background to understand the topic at hand (e.g., general knowledge of computer science, data structures, complexity, systems programming, concurrency, C programming, etc.). Moreover, the recipes are often just skeletons that aim to provide essential information for getting started, but which require the reader to do more research to fill in the details. As such, it is assumed that the reader knows how to use search engines and Python’s excellent online documentation.
Many of the more advanced recipes will reward the reader’s patience with a much greater insight into how Python actually works under the covers. You will learn new tricks and techniques that can be applied to your own code.
Who This Book Is Not For
This is not a book designed for beginners trying to learn Python for the first time. In fact, it already assumes that you know the basics that might be taught in a Python tutorial or more introductory book. This book is also not designed to serve as a quick reference manual (e.g., quickly looking up the functions in a specific module).
Instead, the book aims to focus on specific programming topics, show possible solutions, and serve as a springboard for jumping into more advanced material you might find online or in a reference.
About the Author
David Beazley is an independent software developer and book author living in the city of Chicago. He primarily works on programming tools, provide custom software development, and teach practical programming courses for software developers, scientists, and engineers. He is best known for his work with the Python programming language, for which he has created several open-source packages (e.g., Swig and PLY) and authored the acclaimed Python Essential Reference. He also has significant experience with systems programming in C, C++, and assembly language.
Brian K. Jones is a system administrator in the department of computer science at Princeton University.
- Item Weight : 2.5 pounds
- Paperback : 706 pages
- ISBN-10 : 1449340377
- ISBN-13 : 978-1449340377
- Product Dimensions : 7.01 x 1.41 x 9.17 inches
- Publisher : O'Reilly Media; 3rd Edition (June 4, 2013)
- Language: : English
- Best Sellers Rank: #78,734 in Books (See Top 100 in Books)
- Customer Reviews:
Top reviews from the United States
There was a problem filtering reviews right now. Please try again later.
I bought the Kindle edition in January 2019 wondering if it had a table of contents, as some people said, no, it didn't.
First of all, I wouldn't even try to read the Kindle edition on my Kindle Paperwhite, since the screen is too small and the contrast is not great. Instead, I read it on the Kindle for PC Windows program, and the book is easy to read, including the code examples (this is on a 24" monitor).
I can report that when read on the Kindle PC program, the inline text in the main window does not include a text version of the table of contents. However, on the left side of the Kindle PC program, if you click the icon for "table of contents", a full clickable and expandable table of contents appears in a narrow window to the left of the main text window. This is fully usable as a table of contents, and makes for very easy browsing. There is also a full clickable index at the end of the main body of text. The page numbers in my Kindle edition correspond exactly with the page numbers in my printed version. Another Kindle for PC plus: the example code uses color for syntax highlighting, which is nice.
Edit: Upon further browsing, if you go to the very end of the main text window, there is a clickable text version of the table of contents. It's not so useful at the very end of the document - the left-side table of contents window is much more convenient. This is in the Kindle for PC Windows program.
What’s great are the little explanations of specific stuff and the details that provide a great background-info (like when you’d want to specifically use type.__init__ and not type.__new__ in a metaclass,), and will give full examples, even to a “ridiculous” end to show how it can be done (ie super complicated single meta programming call vs piecemeal with decorators), but since it does the same thing it helps to illustrate that there’s usually an alternative way to do a very specific thing if you need it.
P.S. check out the authors webpage as he has pdf and slides of great info/resources. It’s just as useful (Though not as broad) as the book.
P.P.S. if you’re looking at other books, I don’t recommend the “essential python reference.” You’d be just as good with the general docs.
5 stars for those wanting to understand the under-the-hood mechanics of python as well as mad-scientists testing their limits. 2-stars for beginners, as the first few chapters might be useful, but will largely go over the heads of those just getting started.
One particular recipe that I liked was 9.1 on how to time a function. When I am using Python I often need to time the code, and usually I need to look up how to do it. This example created a decorator function for timing. It makes it so that you can just put @timethis on top of a function and see how long it takes to execute. I appreciated how elegant this solution was as opposed to the way I was implementing it.
Most examples are self contained and all the code examples that I tried worked. Additionally, there is a GitHub that the authors created which provides all the code for the examples if you do not want type it yourself. The examples themselves were applied to real world problems; I could see how the recipe was used clearly. When the authors felt they could not provide an entire solution in the text, they point the correct place to visit online.
The range in topics was impressive. I found the most challenging chapters to be 9, 12, and 15 which were on metaprogramming, concurrency, and C Extensions. At the beginning of the book the recipes cover topics you would expect like data structures and algorithms, strings, and generators. I found myself surprised that I had not seen a lot of the techniques and solutions before. They were well crafted solutions, and I appreciated how much time and detail the authors must have spent to gather the information.
This is a great reference to have by your side when programming in Python.
Top reviews from other countries
The book is structured in sections starting with the basic language constructs (variables, functions and so on), before getting into more detailed examples on classes, networking, Internet, concurrency and a good section on testing and debugging (all code must be well documented).
As someone converting from PHP this has been a revelation in that each section of code snippets has a 'discussion' section to explain the 'why' as wel as the 'how. Other books tell you what/how but rarely the 'why' as this does. Recommended.
As it is a cook book, it's not been read cover to cover but the possibility is there.
However, the book is printed in black and white, unlike the pdf version. This means the readability of code snippet is very bad, ergo loses its value.