

🐍 Code smarter, not harder — your Python mastery starts here!
Python Cookbook 3rd Edition offers over a dozen practical recipes that empower experienced Python developers to write elegant, efficient, and modern code. This O'Reilly classic is a must-have for professionals aiming to deepen their expertise and produce highly readable, pythonic solutions.


















| Best Sellers Rank | 129,171 in Books ( See Top 100 in Books ) 116 in Web Scripting & Programming 157 in Introduction to Programming |
| Customer reviews | 4.5 4.5 out of 5 stars (644) |
| Dimensions | 17.78 x 4.45 x 23.5 cm |
| Edition | 3rd |
| ISBN-10 | 1449340377 |
| ISBN-13 | 978-1449340377 |
| Item weight | 1.1 kg |
| Language | English |
| Part of series | Learning Python |
| Print length | 704 pages |
| Publication date | 23 May 2013 |
| Publisher | O′Reilly |
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.
C**N
Amazing source
Being honest from all the programming books I've got O'Reilly books are the best. Always advanced level information yet you never feel troubled as a beginner. Most books on the market are targeting the quick corner fast track students, but O'Reilly books are more suitable if you want to be Senior dev in the future you should definetely purchase all related programming books with O'Reilly and absorbe all you can. The only thing I wish that they didn't use a rat as cover to their python books. That cover gives me creep, otherwise I would add them to my basket without thinking :)
D**N
Good for converting to Python
This is another cook book of code snippets and explanations and covers Python 3 in this third edition. 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.
S**Y
something here for every Python programmer
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.
A**K
A cookbook to solve problems in python
I have more than 4 years of experience in python and I bought this book to help me increase my skill set in python. This book is only targeted for developers who have some experience in python as it tells the story behind different python modules and how and when to use them. It covers lots of interesting aspects of python. I will definitely recommend it for python developers.
K**V
Outstanding work
Awesome book. It is obvious that the author is deeply acknowledged with Python and computational mechanics. I am impressed with all discussed examples because they solves real world problems and have potential to aid solving more of them. I must say this book is not for beginners although their can benefit too. You cannot simple memorize all examples but have to play around to tweak and use them on practice. Happy coding.
M**C
So good it restores faith in humanity
This book distils elegant programming solutions and explains them in terms that are as simple as possible and as complicated as necessary. No dumbing down. After years of practice, I can still learn from it every day. Keeping it open in your Kindle Cloud Reader makes for a wonderful workflow. Bravo!
S**E
I'm new to Python..
so I thought a cookbook would be a good aid to better climb the learning curve. I have the Kindle version as part of my Python library. The cookbook seems to straddle tutorial and how to accomplish common tasks e,g, how to read a csv file. It also has breadth of coverage including scripting, network and web programming. However don't expect anything on wxPython but numpy is in. At this point in my learning Python its a good resource. At least you can check it out before buying to see if it's the book for you.
M**H
Really good book one should read if want to write more pythonic code. Recommended only for intermediate n advanced python users.
E**4
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**S
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.
W**C
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
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
2 days ago
1 month ago