Goodreads helps you keep track of books you want to read.
Start by marking “Python Cookbook” as Want to Read:
Python Cookbook
Enlarge cover
Rate this book
Clear rating
Open Preview

Python Cookbook

4.13  ·  Rating details ·  776 ratings  ·  36 reviews
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 Pyth
Paperback, 3rd Edition, 706 pages
Published May 29th 2013 by O'Reilly Media (first published July 15th 2002)
More Details... Edit Details

Friend Reviews

To see what your friends thought of this book, please sign up.

Reader Q&A

To ask other readers questions about Python Cookbook, please sign up.

Be the first to ask a question about Python Cookbook

Community Reviews

Showing 1-30
4.13  · 
Rating details
 ·  776 ratings  ·  36 reviews

More filters
Sort order
Aug 08, 2007 rated it liked it  ·  review of another edition
Shelves: read-enough, _owned
Lots of practical recipes for using Python more effectively.

Just to clarify for certain of my friends (you know who you are!):
* Python is a popular computer language, named after "Monty Python's Flying Circus", a British TV comedy
* The O'Reilly Cookbook series uses the metaphor of cooking to present a collection of small, practical solutions ("recipes") to specific programming problems.

Hence, despite my misleading lead-in, the Python Cookbook has nothing to do with preparing snakes for human c
Jul 07, 2013 rated it it was amazing
Shelves: computer
The third edition of Python Cookbook is part of what seems to be a general trend of issuing new editions focusing on Python 3. For me, whose focus is on data analysis and technical computing, this is the time to be thinking about the change from Python 2 to Python 3 as the base libraries of Numpy, Scipy, Matplotlib, and iPython have been ported, and the various other libraries I use that depend on these are being ported as well. But this edition is not just porting the old cookbook, it is a comp ...more
Mark Pergamenshik
May 08, 2018 rated it it was ok
As a Java programmer that wants to learn Python this book was OK.
There are some good recipes but most of the book (about 85%) can be summarized in one sentence "You want to do some job, find third party library to do it for you"
Especially annoying that in some recipes the section ends with something like "there are some better libraries to do this job so use them and not the suggested in recipe?!?!?!"
Some of the recipes are very basic and can be summarized in few lines but in many cases those re
Jeanne Boyarsky
Jun 16, 2013 rated it it was amazing
Shelves: technology
The “Python Cookbook” (3rd edition) is over 600 pages full of content. The recipes vary extensively in difficulty and scope. From simple string concatenation to writing a (BNF) recursive decent parsers.

The book covers Python 3.3. The authors warn some recipes aren't backward compatible with 2.X. While I would have liked more on the transition, I'm not a Python developer – I just do some scripts. It's entirely possible nobody cares about compatibility.

My favorite recipe was on CSV. Paring was sh
Dec 24, 2013 rated it it was amazing  ·  review of another edition
This is idiomatic Python. This book is made all the more enticing by the fact that it focuses on using Python 3. At the time of its publication, it was the best resource for learning how to write lean code using the features available in Python 3. At the time of my writing this review, it is still *the* book I'd recommend for that purpose.

Go get it, and read it twice. Your Python will thank you. :)
Nov 22, 2016 rated it it was amazing
I really liked this book, I learned a lot of Python 3 without even realizing it. When I sat down for a Python 3 project, the new stuff was all second-nature. It covers tons of disparate applications, some of which were over my head. It's a great reference.
Aug 07, 2017 rated it it was amazing
Recommends it for: advanced, beginner (only first few recipes in chapter)
Great book! A must-have on work desk.

It is so well structured: chapters grouped by programming techniques or domain tasks and each chapter has recipes ordered by complexity level. This makes the book good even for not-so-begginer Python programmers, they can just read first 5 recipes in each chapter or read chapter until they start having problems with smooth reading and understanding.
The recipes include only starndard library ingredients however alternative 3rd party tools are also mentioned. T
Nov 28, 2018 rated it really liked it
It is a good reference book. I read half of the book chapter after chapter and then I pick what was interesting. It is a book to come back. I would prefer if the book had some basic introduction to Python for beginners. I have programming background in C++, Java, PHP, Scala, but haven't had that, it would be way too difficult to go thought. There are many topics and terms that are not explained: closures, packages, lambda, etc. so some basics are required.
Jul 29, 2018 rated it really liked it
Shelves: tech
Very useful. An excellent reference. Essential even.

I also recommend reading it cover to cover. That is tough going (it’s an all-encompassing tome) and will take some time. However it’s incredibly valuable for helping shrink the space of unknown unknown best practices in Python. “Oh wait, isn’t there a better way of loading package data files... yes, that’s right...”
Dec 01, 2018 rated it it was amazing
Excellent material for acing for python skill. This is not for beginners though. You need to have some hands on experience in python to grasp the material. Different recipes to help you understand the advanced concept of the language. This book will make your day job easier. Highly recommended for anyone want to perfect python skill.
Aug 07, 2017 rated it really liked it  ·  review of another edition
This is a great tour through the "fancier" tools available in Python.

(What are generators and iterators and why would you use them? Are there elegant built-in tricks for string parsing and data structures? etc.)

It's structured as "problem: solution!" and is very dense but clear. Works either for reading cover-to-cover and using as a reference.
Stephen Cook
Apr 03, 2019 rated it really liked it
Excellent compendium of Python recipes and idioms. Particularly useful for experienced programmers who want to become proficient quickly with Python but avoid importing assumptions from other languages.
Mahmud Ahsan
Mar 28, 2018 rated it it was amazing  ·  review of another edition
Very good book to know about some quick solution for common problems.
Eric Casteleijn
Sep 19, 2015 rated it really liked it
A solid Python reference, containing recipes for many common tasks. A valuable addition to any Pyhonista's library.

If I had to find fault with anything it's that the code samples could use a little cleaning up. The coding style is inconsistent (understandably with two authors), and not always in agreement with generally accepted best practices (pep8). I feel running the examples through a linter would have fixed that, but it's immaterial to the utility of individual examples.
Dave Peticolas

This Python programming cookbook lives up to the standard set by the excellent Perl Cookbook. In addition, this book is associated with a website where the programming recipes were originally collected from Python users. The website continues to grow and collect new recipes and thus represents a great resource for Python programmers.

Sep 01, 2010 rated it really liked it  ·  review of another edition
Shelves: programming, guide, tech
I'm glad to be done with this for now, as I am with most books intended for reference use that I try reading cover to cover. Nevertheless it's a great resource, and I think the recipes here are a bit higher quality than some of the other O'Reilly Cookbook titles. Good cross-referencing and encouragement to refer to material in related chapters. An essential reference if you are learning Python, and a source for some great ideas.
Oct 03, 2014 rated it it was amazing
I think there is no option as 'currently-reading' and 'read', because you reference to that book and collecting knowledge step by step. And i can say that this book is really good cookbook, maybe python as a language makes it much better as it would be with another language, but anyway. It's really good one!
May 29, 2007 rated it it was amazing  ·  review of another edition
Recommends it for: Python programmers
Shelves: computers, python
I love the cookbook series. Lots of clever tricks and details about the language you didn't know before. Plus I have to recommend this because recipe 7.3 "Using Compression with Pickling" is the first thing I've ever had published in a book.
May 04, 2014 rated it it was amazing
This is guide book with interesting and unexpected examples and trics. Best approach - reading chapter, which has actually information for you current task.

Third (3) edition is best, don't read previous versions.
Anton Antonov
Mar 05, 2015 rated it it was amazing
Shelves: technical
A must-have for every Python developer aiming to code in the most Pythonic way.

The authors' discussions, approaches and solutions to problems are way better than what the current Python docs can offer. I found it most useful for Iterators, Generators and Meta-programming.
Jul 23, 2013 rated it it was amazing
Shelves: professional
Perfect book for the non-newbie. Clear and well explained recipes for typical problems.
Nov 21, 2014 rated it it was amazing
Shelves: programming
If you want to switch from Python 2 to 3, this book might help you.
Mar 15, 2013 rated it it was amazing
Shelves: oreilly
Excellent book! Really learned a lot from it.
Nov 05, 2012 rated it liked it  ·  review of another edition
Shelves: partially-read
Partially usable, definitely a cookbook is not for me...
For a software recipe I just prefer StackOverflow.
Matej Tacer
May 18, 2014 rated it it was amazing  ·  review of another edition
Shelves: reference-books
Quite an old edition, but still a relevant and invaluable Python resource. Very dense, providing high level recipes for daily use. Not for beginners, but a great reference book.
May 13, 2014 rated it it was amazing
Shelves: python
Very recommended for every python developer.
Most of the receipts stands for their own and shows, with clear explanations, how to achieve selected goals using elegant, readable, code.
Srinivas Reddy Thatiparthy
Feb 03, 2016 rated it it was amazing
Any thing comes from David Beazley just buy it, Period!!
Chris Sosa
Good as a reference book but not that great otherwise
Andrew Montalenti
the book that taught me that Python is highly practical
Nov 24, 2012 rated it it was ok  ·  review of another edition
It's just 'okay' as far as a python cookbook is concerned. Aids programming practice, but lacks subtle qualities of a readable text.
« previous 1 next »
There are no discussion topics on this book yet. Be the first to start one »

Readers also enjoyed

  • Python in a Nutshell
  • Programming Python
  • Python Essential Reference (Developer's Library)
  • Core Python Programming
  • Linux System Programming: Talking Directly to the Kernel and C Library
  • Programming in Python 3: A Complete Introduction to the Python Language
  • Learning the bash Shell
  • Think Python
  • Dive Into Python
  • Natural Language Processing with Python
  • The Quick Python Book
  • Beginning Python: From Novice to Professional
  • Test-Driven Web Development with Python
  • Regular Expressions Cookbook
  • Rails Recipes
  • Programming Perl
  • Mining the Social Web: Analyzing Data from Facebook, Twitter, LinkedIn, and Other Social Media Sites
  • Practical C Programming
See similar books…

Goodreads is hiring!

If you like books and love to build cool products, we may be looking for you.
Learn more »
“words = [    'look', 'into', 'my', 'eyes', 'look', 'into', 'my', 'eyes',    'the', 'eyes', 'the', 'eyes', 'the', 'eyes', 'not', 'around', 'the',    'eyes', "don't", 'look', 'around', 'the', 'eyes', 'look', 'into',    'my', 'eyes', "you're", 'under' ] from collections import Counter word_counts = Counter(words) top_three = word_counts.most_common(3) print(top_three) # Outputs [('eyes', 8), ('the', 5), ('look', 4)]” 0 likes
More quotes…