Vous voulez voir cette page en français ? Cliquez ici.

Have one to sell? Sell yours here
Tell the Publisher!
I'd like to read this book on Kindle

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

Python Cookbook [Paperback]

Alex Martelli , David Ascher
5.0 out of 5 stars  See all reviews (9 customer reviews)

Available from these sellers.

There is a newer edition of this item:
Python Cookbook Python Cookbook
CDN$ 32.92
Usually ships in 9 to 11 days
Join Amazon Student in Canada

Book Description

July 29 2002 0596001673 978-0596001674 1

The Python Cookbook is a collection of problems, solutions, and practical examples for Python programmers, written by Python programmers. Over the past year, members of the Python community have contributed material to an online repository of Python recipes hosted by ActiveState. This book contains the best of those recipes, accompanied by overviews and background material by key Python figures.The recipes in the Python Cookbook range from simple tasks, such as working with dictionaries and list comprehensions, to entire modules that demonstrate templating systems and network monitoring. This book contains over 200 recipes on the following topics:

  • Searching and sorting
  • Manipulating text
  • Working with files and the filesystem
  • Object-oriented programming
  • Dealing with threads and processes
  • System administration
  • Interacting with databases
  • Creating user interfaces
  • Network and web programming
  • Processing XML
  • Distributed programming
  • Debugging and testing
  • Extending Python
This book is a treasure trove of useful code for all Python programmers, from novices to advanced practitioners, with contributions from such Python luminaries as Guido Van Rossum, David Ascher, Tim Peters, Paul Prescod, Mark Hammond, and Alex Martelli, as well as over 100 other Python programmers. The recipes highlight Python best practices and can be used directly in day-to-day programming tasks, as a source of ideas, or as a way to learn more about Python.The recipes in the Python Cookbook were edited by David Ascher, who is on the board of the Python Software Foundation and is the co-author of Learning Python, and Alex Martelli, who is known for his numerous and exhaustive postings on the Python mailing list. The book contains a foreword by Guido van Rossum, the creator of Python.

Customers Who Bought This Item Also Bought

Product Details

Product Description


"I have no reservations recommending this book." - Tim Penhey, Cvu, February 2003

From the Publisher

The Python Cookbook is a collection of problems, solutions, and practical examples for Python programmers, written by Python programmers. It contains over two hundred recipes for text manipulation, object oriented programming, XML processing, system administration, and much more. This book is a treasure trove of useful code for both novices and advanced practitioners, with contributions from such Python luminaries as Guido Van Rossum, Tim Peters, Paul Prescod, and Mark Hammond.

Sell a Digital Version of This Book in the Kindle Store

If you are a publisher or author and hold the digital rights to a book, you can sell a digital version of it in our Kindle Store. Learn more

Customer Reviews

4 star
3 star
2 star
1 star
5.0 out of 5 stars
5.0 out of 5 stars
Most helpful customer reviews
2 of 3 people found the following review helpful
5.0 out of 5 stars Valuable tricks&tips from _real_ Python experts Oct. 11 2002
Of the many successes of Python, this is the least known but one of the most impressive: it has gained the affection and the respect of a hard guy like Alex Martelli. That is not an easy task for a small, interpreted programming language like Python.
When I first met Alex Martelli, at Think3, he was one of the oldest and most experienced programmers of the company, a programmer who had already used most of the existing languages and had used these languages for the development of large and complex applications, the kind of projects that took months or years to complete. He knew Perl very, _very_ well and was used to rely on a robust, elegant and sophisticated language like C++ for the development of his applications (like Think3's Thinkdesign, a very complex 3D CAD program). He was writing a _lot_ of software, using a large array of different languages and tools. He was a well respected internal consultant at Think3, charged to solve difficult problems related to the software architecture of the program being developed. He was not an easy guy to impress with "yet another small language".
Despite this, Python has gained some room in his heart. I consider this fact as one of the most significant success of this elegant and powerfull language. To be completely honest, I'm not completely surprised by this ending.
Alex Martelli is the kind of scientist and professional that appreciate elegance, wherever he can see it. The taste for elegance, the ability to take pleasure in elegance, is an important part of the scientist and engineer personality. It is hard to be a really good software professional without having any kind of interest for elegance. When you need a simple tool that can face complex problems, you are asking for elegance.
Read more ›
Was this review helpful to you?
2 of 3 people found the following review helpful
5.0 out of 5 stars Perfect Oct. 15 2002
This is one of those rare books that is all meat and no fat. It is a wonderful collection of relevant and useful solutions for many programming problems that you will face, and many that you probably just figured were too hard to solve. It is clearly laid out, so finding a needed solution is easy.
One of the most powerful benefits of owning this book is astonishing amount of knowledge you can pick up by browsing it. With almost every recipe I discovered either a new approach to doing something with Python, that was far more elegant than what I would have thought of, or something that I didn't even consider was possible. It covers a vast array of important topics, from text processing, threads, object-oriented programming, and much more.
In short buy this book, grab a drink, and have a nice long sit-down session with it. You'll love every page of it.
Was this review helpful to you?
5.0 out of 5 stars Broad, but organized June 8 2012
Format:Paperback|Verified Purchase
Like all O'Reilly texts, this one is well-written and easy to use. I bought it to improve my Python skills and to be able to look at quality examples of common Python applications. It also explains common pitfalls. Obviously this is not a text useful for learning the basics to Python (there's another great O'Reilly text for that).
Was this review helpful to you?
1 of 2 people found the following review helpful
5.0 out of 5 stars Superb collection of useful snippets Oct. 11 2002
This book is a superbly edited collection of recipes that originally appeared online containing corrections and updates to the programs, much added discussion, many additional recipes, and fourteen extended chapter introductions. Each snippet is first briefly introduced, then completely and clearly discussed at length. The explanations are easy for beginners to understand, without being in the least condescending, while offering a huge feast for more experienced programmers.
This book has garnered rave reviews on comp.lang.python, the internet newsgroup devoted to Python. Some examples:
"The book is uniformly fantastic, congratulations to the authors!"
"I should note that this is not much like a usual Cookbook, which offers quick "do things this way" recipes to follow, almost blindly. Instead it offers deep discussions of various approaches and uses state-of-the-art techniques (e.g., list comprehensions) that may not be at all obvious to newcomers."
"I would recommend something like Learning Python as a first book. But then Python Cookbook is the second book to get, or the first for those who have been with the language a while."
"I am sure it will be a long time before I have exhausted it. As someone whose recipes were accepted for publication I can only say that, given all the changes and enhancements, the editors were generous in their credits."
"You could actually leave out the code, change the title to 'The Python Philosophy' and still have a really valuable book."
To which the reply was:
"Nowhere quite as valuable, in my humble opinion. It's not just the 200+ recipes, it's the numerous snippets that show very directly how to do one thing or another...
Read more ›
Was this review helpful to you?
1 of 2 people found the following review helpful
5.0 out of 5 stars Cookbook every Pythoner should have Jan. 17 2004
This book is based on ActiveState on-line library of python recipes which were selected and edited by two well known experts, industry veteran Alex Martelli and David Ascher, with the help from other Python experts.
Recipes are organized in seventeen chapters. Chapters begin with short introduction on the topic covered, and is well worth the reading alone (even if you're primarily interested on a specific recipe take the time and read the introduction text). Each recipe is comprised of four sections: Problem definition -> Solution (code) -> Discussion -> Pointers to other relevant recipes or material.
No matter how proficient you're at coding in Python you'll certainly found some useful tips, new approaches or coding techniques. Usually technical books have strong and weak parts which I point out in my reviews, this one is different. As someone before me stated, this book is all meat and no fat. What else do you want from your diet?
Was this review helpful to you?
Want to see more reviews on this item?

Look for similar items by category