BUY THIS BOOK

Safari Books Online

What is this?

Looking to Reprint this content?

Python Cookbook

Edited by Alex MartelliDavid Ascher
First Edition  July 2002 
Pages: 606
ISBN 10: 0-596-00167-3 | ISBN 13: 9780596001674
starstarstarstarstar (Average of 1 Customer Reviews)

This book has been updated—the edition you're requesting is OUT OF PRINT. Please visit the catalog page of the latest edition.

The latest edition is also available on Safari Books Online.

Book description

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.
Full Description

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.

Browse within this book

Cover | Table of Contents | Colophon




Featured customer reviews

Write a Review


Python Cookbook Review,  May 02 2003
Rating: StarStarStarStarStar
Submitted by Will Guaraldi   [Respond | View]

I've been doing Python programming for some 5 years now and lurking on the python-dev list for a little under a year. That's where I'm coming from. Even with that, I find the recipes in this cookbook fascinating and it's a great tool to have when I'm writing those scripts that I need to put together quickly without thinking through things. The recipes cover a broad spectrum of problem domains--an attribute that I would have thought would be detrimental, yet it doesn't adversely affect the depth. The discussions in regards to some of the recipes is very insightful--some of the easier and more obvious recipes have discussions that kind of belabor the point (at least in my eyes). That's my only nit. Excellent book. Definitely worth having on the bookshelf especially if you do a lot of Python wrangling.

Read all reviews


Media reviews "I have no reservations recommending this book."--Tim Penhey, Cvu, Feb 2003

"The 'Python Cookbook' is superb. Demonstrably so, in fact. Most book reviews are matters of judgment and discrimination, dependent on the taste and wisdom of the reviewer. PC's quality is so unique that it deserves a different, more objective style of review... PC is so good that it's hard to go wrong buying a copy for yourselves or others. I write that with confidence because the words aren't mine. Shortly after PC hit the bookshelves at the end of summer, Python programmers began talking about it--at interest group meetings, over lunch, and in all sorts of online forums. Agreement was near universal that the book is extraordinary."
--Cameron Laird, Unix Review.com, Jan 7, 2003

"I can recommend the 'Python Cookbook' wholeheartedly to anyone who has passed into the advanced stage of language learning and is willing to actually sit down and work through the code. Anybody who is looking for a deeper understanding of Python, solutions to common coding problems, or starting points for their own projects will also profit....The editors have done a good job of nailing the parrot."
--Nice2Cats, slashdot.org, October 9, 2002

Read all reviews

See larger cover