

Buy anything from 5,000+ international stores. One checkout price. No surprise fees. Join 2M+ shoppers on Desertcart.
Desertcart purchases this item on your behalf and handles shipping, customs, and support to Bahamas.
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 I/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 Review: Treasure Trove of Python Recipes - Python Cookbook goes in depth on a variety of different Python topics. Each section is similar to a question that might be asked on Stack Overflow. The recipes range in difficulty from easy to advanced metaprogramming. 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. Review: Great book, Kindle version has table of contents - I already have the print version of this book, and like it a lot. It's full of very instructive examples that you can study and learn from. 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.















| Best Sellers Rank | #403,709 in Books ( See Top 100 in Books ) #179 in Microsoft Programming (Books) #230 in Python Programming #255 in Software Development (Books) |
| Customer Reviews | 4.6 out of 5 stars 665 Reviews |
W**S
Treasure Trove of Python Recipes
Python Cookbook goes in depth on a variety of different Python topics. Each section is similar to a question that might be asked on Stack Overflow. The recipes range in difficulty from easy to advanced metaprogramming. 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.
J**C
Great book, Kindle version has table of contents
I already have the print version of this book, and like it a lot. It's full of very instructive examples that you can study and learn from. 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.
D**N
Wisdom - not just examples. Best viewed on a larger screen
The Active State repository of Python recipes includes many gems, but as the Authors observe in their preference: "most of these recipes are steeped in history and the past". I'd add that the signal to noise ratio seems to be decreasing. The most prolific contributors (with the exception of Raymond Hettinger) have posted trivial examples rather than recipes. This book includes some simple examples too, but it's always in the context of a larger message. Excellent content and advice without the chaff. I just bought this today. Unlike some early technical Kindle books I've purchased, the formatting is excellent. Kudos to the authors and publisher. But when I first browsed the content with Kindle-Android on my 7" tablet (Nexus), I still found it frustrating to read. Next, I tried my laptop with a 14" screen - better. And then tried it on my PC with a large monitor and found reading and jumping around the content much more productive and pleasurable. Switched back to the tablet, I changed the text settings to minimums for font size, margin size, line spacing and entered full-screen mode. Result: much better! That said, I still found the much larger screen area on my PC monitor preferable. Bottom Line: Buy this for great Python 3.3 code and advice in a flexible format.
D**S
A good addition to my Python library
Overall a worthwhile addition to my Python library. I thought at first that the coverage levels were uneven - some of the data structures discussion could easily be grasped by a beginner but the Class recipes were very deficit to comprehend. That may be more indicative of indicating where I'm not up to speed in my Python than anything to do with the writing. The text by itself is pleasant and non-academic with clear explanations. There is, admittedly, a lot in the book that is currently well beyond my understanding (I'm a retired programmer but never worked in most of the areas covered), so the book additionally has provided a challenge to learn from someone who obviously knows what they're doing.
M**L
Broad scope, useful code snippets, and good examples. Helpful at any level of Python indoctrination.
Beazley has a 'deeply clueful' understanding of Python. What you see in this book is not just how to get things done, but how to do it in the 'Pythonic' fashion. It shows you how to work with the language, not just implementing it with generic 'this will work in any language' constructs. This book has showed me how to do a lot of new things, and even if I already knew how to do something, now I know how to do it better, faster, cleaner, or more robustly. The book is also well written. Finding the material, and reading through the narratives for particular snippets of code is very clear, there's rarely a need to go back to re-read anything, ideas are conveyed simply but effectively. I own a bunch of other Python books, but they all have a time and place in your learning process. This book spans so much material, that it is much more universal; I keep going back to it to look things up, sometimes for no other reason but to verify that I'm on the right path.
K**N
I learned more from this book than all others combined. Seriously the best.
Honestly, the best book on Python I’ve seen (4 years experience, myself). David Beazley is hands down my favorite “instructor,” and I’m re-purchasing the book because I destroyed my old one from highlighting/writing etc all over it. 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.
C**Y
Fantastic reference book
This is certainly not for beginners, but it is an extremely handy reference for how to do most tasks of various levels of madness in python. The discussions are brief, but thorough enough to give you a solid grasp on the particular snippet of code. It's also great for showing pythonic ways of utilizing the tools at hand. It does not motivate these tasks, you need to know what you're looking for, but even a brief read-through can shine light on things you never thought were possible in the standard library. 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.
G**Y
Programming Pearls... Reloaded
Having read some humdrum works in the Cookbook series, my expectations were not very high. However, I soon discovered that this book is in a different league. When he discusses a problem, Beazley gives you his favorite solution. He also presents alternatives, discusses pros and cons, and calls your attention to subtle details in the solution --- leaving you with a feeling of having learned something of value. But that's only the beginning. It's hard to describe the pleasure of reading some of the solutions in the Iterators and Generators section, for instance. Actually, I take that back. The pleasure is the same kind as what you may have felt when you first came upon ideas in books such as Bentley's Programming Pearls, way back when. I hadn't felt that excited about a programming book in a long time. This is one you can take along with you on a weekend just for the pleasure of sipping from it. Sad to say, but there are many O'Reilly books I feel like passing on soon after acquiring them. This one will have a special place on the shelves.
M**H
Best book for Python 3
Really good book one should read if want to write more pythonic code. Recommended only for intermediate n advanced python users.
M**E
Just buy it!
This is by far the best companion for a Python (3) developer. It contains so much recipes and so much advice that using it it's just a pleasure. You are able to produce super elegant code, minimising the lines of code and maximising the code readability. I suggest it to everybody is already a bit proficient in Python and just wants to acquire more immediate and elegant way of coding. Let's say this is a book for who really wants to produce beautiful pythonic code.
E**4
Une référence
Excellent livre qui permet de progresser et de produire un code très efficace. Les exemples sont très didactiques, ne tombent pas dans des détails oiseux et se concentrent sur ce qui est à expliquer. De très nombreux thèmes sont abordés et il est facile de développer ses propres solutions à partir de là. Je me réfère à ce livre systématiquement pour mon code. Pour ceux qui connaissent Python, si il y a un livre sur Python à acheter, c'est celui-ci.
W**C
Gutes Buch mit zahlreichen python 3.x Rezepten
Wenn man noch python 2.x code schreiben muss, dann hilft diese Buch nur bedingt. Zwar kann man einiges zurückportieren, aber das ist nicht im Sinne des Erfinders. Auch lehrt einem dieses Buch nicht programmieren für Anfänger oder den Einstieg in python. Es ist eine Sammlung an möglichen Lösungen in python3 zu bestimmten Problemen. Die Rezepte sind allesamt getestet mit python 3.3 und auf python 3 ausgelegt. Dort spielt es seine Stärken anhand einer klar strukturierten Herangehensweise aus. CSV Dateien einlesen? JSON Exportieren? Ein Blick ins Inhaltsverzeichnis lohnt immer. Auch sind alle Code-Schnipsel auf [...] einsehbar. Wer also Anregungen braucht - dann ist das eine klare Kaufempfehlung.
M**N
Amazing book, love it!
I have been programming with python for 3-4 years, every time I open this book, I learn one new and awesome thing from it. I love the way the authors look at the problems and give you a creative solution.
Trustpilot
1 month ago
1 month ago