Customer Reviews


46 Reviews
5 star:
 (26)
4 star:
 (15)
3 star:
 (2)
2 star:
 (2)
1 star:
 (1)
 
 
 
 
 
Average Customer Review
Share your thoughts with other customers
Create your own review
 
 
Only search this product's reviews

The most helpful favorable review
The most helpful critical review


26 of 30 people found the following review helpful:
5.0 out of 5 stars Perfect
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...

Published on October 15, 2002 by neurorat

versus
84 of 89 people found the following review helpful:
3.0 out of 5 stars Half-cooked
Good:

As other reviewers have pointed out, this book offers solutions for a broad range of programming problems. There is something for every level from beginner to expert (the most advanced examples were well over my head). The recipes are enhanced by discussions that are mostly very well and clearly written, giving insight into the design and logic of the presented...

Published on September 6, 2005 by Michael Palmer


‹ Previous | 1 25| Next ›
Most Helpful First | Newest First

84 of 89 people found the following review helpful:
3.0 out of 5 stars Half-cooked, September 6, 2005
By 
Michael Palmer (Waterloo, Ontario Canada) - See all my reviews
(REAL NAME)   
This review is from: Python Cookbook (Paperback)
Good:

As other reviewers have pointed out, this book offers solutions for a broad range of programming problems. There is something for every level from beginner to expert (the most advanced examples were well over my head). The recipes are enhanced by discussions that are mostly very well and clearly written, giving insight into the design and logic of the presented recipes. They thus guide the way to adapting the recipes to your own programs.
So, most of the content of this book is good. 4-5 stars for that.

Bad / Production:

The recipes (so I gather) are mostly edited versions of what is available at ActiveState's online cookbook. However, the edited versions seem not to be available online (at least there is no pointer, and O'Reilly's website does not provide one either). Nor does the book include a CD. For all the hype in the book about this being a book by the Python community for the Python community, this is disappointing. Not even pointers are provided to on-line cookbook recipes that were used as starting points for those printed in this book. This is just bad craftsmanship on the part of O'Reilly. (On a similar note, the back cover promises a foreword by Guido but there isn't one.)

Bad / Content:

Sugar is sweet but bad for your health. So it is with this book - too many recipes add only (syntactic) sugar but no minerals and vitamins. Several 'shortcuts' are just wasted ink and breath - they will save you 1-2 lines of code when writing a function but then you have to import the shortcut implementation and get to make the extra function calls... Where these 'shortcuts' help to avoid some Python gotchas, it would have been more useful to just document the gotcha in question and show how to avoid it in straight Python code without any sugaring. Case in point: The once-only initialization of function default arguments. If you write:

def foo(bar=[])
bar.append(quux)

then previous quuxes will be lurking in the bars of every subsequent foo call that does not pass bar itself. So, you must write:

def foo(bar=None):
if not bar: bar=[]

to get an empty [] for every call. Now does this 'problem' merit a more elaborate, sugary 'solution'? I don't think so.

Some recipes are recipes for disaster. We are told how to automatically call the __init__ routines of every superclass... what we are not told is how to automatically call them in the appropriate order or with the respective arguments for making things work. How often do you write an __init__ that takes only the 'self' argument? Sure, it occurs, but... The omission of implicit superclass calls was a conscious design choice in Python and a wise one at that. Too many recipes like this one just want to show you how to subvert Python's conscious design choices. The sweet taste won't last but give way to heartburn.

For a book of this scope and design it is of course impossible to avoid criticism of the kind 'why did you include A but not B...'
Still, here goes:

XML: There are excellent libraries such as ElementTree and now cElementTree that offer fast, clean and 'Pythonic' alternatives to the standard library modules for XML parsing. More than just a URL pointer should have been provided.

Web programming: Only Jython and Twisted are mentioned as alternatives to CGI. Now Twisted may be the greatest thing since sliced bread, but ordinary mortals will never know, because it has about the the most confusing and unfathomable documentation of anything on the web (ooh I forgot Zope...). Presenting Twisted 'recipes' (or rather, plugs) with 'discussions' that drone about its power but are again just the same handwaving stuff as in the on-line docs is useless.

(If you just want to get your web stuff done with minimal pain: For simple PHP-like embedded scripting but with the advantages of Python, look at Spyce, and for an easy application server, look at Cherrypy or Webware).

So, altogether, a good book but not quite on par with e.g. Python in a Nutshell.

Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


26 of 30 people found the following review helpful:
5.0 out of 5 stars Perfect, October 15, 2002
By 
This review is from: Python Cookbook (Paperback)
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.

Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


21 of 24 people found the following review helpful:
4.0 out of 5 stars A Fun Resource for Python Programmers at Most Levels, November 1, 2005
This review is from: Python Cookbook (Paperback)
Full disclosure: I purchased the first edition of this book, and received the second edition as a reviewers copy. I work for Zope Corporation.

The O'Reilly Python Cookbook is a fun resource for Python programmers at most levels. The fun comes in part from the personalities that shine through the introductions and the community-authored recipes gathered from the ActiveState Python Cookbook website. The other fun comes from the smorgasbord of topics and technologies laid out for the reader, encouraging browsing and experimentation. New Python programmers will find recipes that highlight some of the newer features of the Python language, and experienced Python programmers will likely find thought-provoking recipes both peripherally and directly related to their specialties and interests.

Like the first edition, this second edition covers a wide range of topics. Each topic has a usually-interesting introduction by well-known names in the Python community. Some topics are of general interest-shortcuts and algorithms, for instance-while others explore somewhat more specialized topics, such as networks, XML, and databases. Each cookbook recipe I read was impressively short, while often still having enough weight to them to address non-toy usages of the approaches. Many examples can also be used as introductions to the modules and packages they use. Another important similarity to the first edition is that a portion of the proceeds from the book sales are donated to the Python Software Foundation.

This edition of the cookbook does have some significant changes from the previous one. While the first edition addressed Python versions in the 1.x and 2.x line, this one addresses only Python 2.3 and 2.4. It adds about a third more recipes than the first edition, and tops the first edition's page count by over 200 pages. Some of the new additions address relatively new packages, such as the datetime, dateutils, pytz, and decimal packages, while others focus on older packages that are waxing in their influence and popularity, such as Twisted. Many recipes are more polished, such as the "Synchronizing All Methods in an Object," which has an arguably more general purpose approach and an interesting discussion in the new edition.

Omissions are sometimes as interesting as inclusions in recipe books, but an interpretation of their significance can be difficult. The new edition dropped almost 100 of the first edition's recipes. In the "Distributed Programming" topic, the SOAP references in the first edition have disappeared, and a recipe for Twisted's Perspective Broker has surfaced. While the Perspective Broker is an interesting technology with an elegant cookbook example, the seeming judgement-SOAP is now less worth discussion than one of the Twisted project's packages-might raise some eyebrows. Similarly, Zope and the ZODB (Zope Object Database) are acknowledged as heavyweights in the introductions to their respective topics ("Web Programming" and "Persistence and Databases"). Zope 3 is even granted a rave review: "The new, revolutionary major release, Zope 3, makes Zope more Pythonic and powerful than ever." But not a single recipe can be found for either, in either edition. Perhaps that simply is indicative that the Zope community ought to pay more attention to the Cookbook website.

This returns us to the initial observation of this review: the cookbook is a community driven project, and thus reflects the personalities of the programmers who contributed to it, rather than necessarily to trends of the Python or IT community. But it also benefits from the energy and enthusiasm of the contributors who often have palpable excitement for the technologies they are demonstrating. This also makes me more interested in the book as a source for introductions than as a source for ready-made recipes.

If a picture is worth a thousand words, a working, explained example of a new package ought to be worth quite a few too. The cookbook is a fun browse and a fun introduction to other aspects of the Python language. While I have found myself using one or two of the recipes from the first edition, that use alone is not enough to justify the cover price. It is more compelling to me as a fun introduction to Python topics and approaches. In that light, I recommend it.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


27 of 32 people found the following review helpful:
5.0 out of 5 stars More of an encylopedia than a cookbook, August 15, 2002
This review is from: Python Cookbook (Paperback)
This book is more like an encyclopedia than a cookbook - each section is introduced and written in a different style and different sections are stronger and more cohesive than others. Some sections are bursting at the hinges and others feel like they are incomplete (like the algorithms section).

The introductions to each chapter alone are worth the price of the book. Each introduction is written by a different Pythonic luminari, such as Fredrik Lundh, Tim Peters, Alex Martelli, Guido van Rossum and many others. These literary pieces are insightful, humorous and excellent.

I love python, it follows Albert Einstein's principle « Everything should be as simple as it is, but not simpler ». As such, this book plays a valuable addition to my library. However, if you are just starting out I would recommend getting a different book first.

Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


75 of 95 people found the following review helpful:
5.0 out of 5 stars Valuable tricks&tips from _real_ Python experts, October 11, 2002
This review is from: Python Cookbook (Paperback)
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. When you need a language that leave you with maintenable code, you are asking for elegance. When you want a single language for a wide array of applications, you are asking for elegance. Python can supply you with all the elegance you can ever ask for.

Alex's and David's book is a collection of good techniques that you can use to face a large set of problems with Python, from text transformation to GUI building to OpenGL grahics. You will not find here an introductory book, rather you will find a good second-reading book, the kind of book that can take you from the beginner level to the advanced. It is also the kind of book that can widen your knowledge of the Python world, showing you how this modern language can easily deal with problems that you usually face with C++ or the like.

If you are looking for an introductory book, buy "Learning Python" by Mark Lutz and David Ascher: it is the best one for this task. If you already know Python, buy this book and see how much you still do not know about it.

Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


8 of 8 people found the following review helpful:
4.0 out of 5 stars More than a cookbook, August 6, 2006
This review is from: Python Cookbook (Paperback)
String handling, money, time, dates. Email, network sockets, cgi, xml. The staples of the cookbook, and Python Cookbook certainly has these. However, interspersed throughout are chapters that seem to have come from at least one other completely different book, a more discursive rumination on Python programming in general. Each chapter begins with a mini essay from a Python luminary, and the discussion of each recipe is fairly extensive.

If you do any scientific or engineering work, you'll know that Python is everywhere on the scientific desktop, providing bindings, scripting and GUI front ends for ancient Fortran/C monstrosities. Reflecting this interest, there is a strong emphasis on performance, with chapters devoted to algorithms and searching and sorting.

Elsewhere, those who have graduated from the plethora of beginner's books, but have been bemused by the complete lack of any intermediate texts, will be pleased to find chapters on Python shortcuts (getting the most out of sequences for the most part) and one on generators and iterators. Futher, there is a chapter on OOP the Python way (including examples of dynamic delegation and design patterns implementation), and one on metaclasses.

This is an extremely useful book, particularly the chapters on using Python's basic collections, which will furnish the reader with some essential idioms for efficient use. However, this, and the OOP chapters would have been better as a separate book. But in lieu of a Thinking in Python or Effective Python, you need this book if you want to do any serious development in Python.

As a cookbook, it has everything you will be expecting as a springboard for exploring the standard library, except for regular expressions. But these are so well covered in introductory books, that you won't need enormous coverage here. On the other hand, the material is presented in a fairly wordy manner, which makes for interesting reading, but for dipping in and out, makes finding things more difficult than it might be.

The other notable thing about Python Cookbook is that it has rather a large number of errors in it. You will want to check the O'Reilly website for the errata, especially if you don't have the most recent printing, rather than scratching your head over why the Singleton implementation doesn't work at all.

Nonetheless, this is a vital resource for Python 2.4 users; even if you don't think you need a traditional cookbook, there is an enormous amount of material here you can benefit from.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


9 of 10 people found the following review helpful:
5.0 out of 5 stars Useful code samples, illuminating commentary, deep insights, October 14, 2002
By 
Hamish Lawson (St Andrews, Scotland) - See all my reviews
This review is from: Python Cookbook (Paperback)
With this kind of book, there is a danger of just reproducing in print a set of libraries that might have been more conveniently downloaded from a code repository. The "Python Cookbook" succeeds by concentrating on those idioms and techniques that can often be woven into various programs; in addition the accompanying commentaries usually do an excellent job of leaving the reader with a better understanding of the relevant issues. The value of the book is increased further by the well-written chapter introductions, which often yield deep insights into the Python way of doing things.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


8 of 9 people found the following review helpful:
2.0 out of 5 stars Go to the website, February 18, 2009
This review is from: Python Cookbook (Paperback)
I bought this book when Python was relatively young and it definitely got the job done on more than a few occasions. The language (and the book) has evolved and some of the recipes are a bit outdated. If you look up Python Cookbook recipes on Google or some other search engine, it will take you to the ActiveState site that has all of these recipes and more. Two stars because the book is valuable in that it is concise - searching through a slew of recipes on a site can be a bit of a chore.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


13 of 16 people found the following review helpful:
5.0 out of 5 stars Superb collection of useful snippets, October 11, 2002
By 
Edward K. Ream (Madison, WI United States) - See all my reviews
This review is from: Python Cookbook (Paperback)
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... then, sure, the text can also be quite helpful by showing what is going on, what's preferable under what conditions, and so on..."

The general consensus seems to be summed up in this posting:

"If you are serious about Python then get this book."

To which I replied:

"I couldn't agree more. I won't embarrass myself by telling all the things I learned in the first chapter. This really is an awe-inspiring book for the breadth of its coverage and the complete excellence of its presentation. The authors and especially the editors deserve the highest praise. Even when explaining the most elementary topics the editors manage to be interesting and even surprising. I have already turned down the corners dozens of pages that I want to study in detail. In short, this is just a superb job. It shows the power of a community of users enhanced by the editing of all-stars."

About the reviewer: Edward K. Ream has more than 30 years of programming experience and is the author of a major application written in 100% pure Python. While working on this project he has benefited greatly from the help given on comp.lang.python, often by the contributors and editors of the Python Cookbook.

Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


5 of 5 people found the following review helpful:
5.0 out of 5 stars Rethinking Cookbooks, October 14, 2006
By 
This review is from: Python Cookbook (Paperback)
Normally, I'm not a big fan of cookbooks, I find them full of little patterns and quick solutions, but I don't have any desire to read them cover to cover to improve my design and implementation skills. The book Python Cookbook, 2nd Edition is quite different.

After hearing one of the authors, Alex Martelli, talk about object oriented programming at pycon2005 (you can probably find the link on a9) I picked up an electronic copy of his cookbook, through safari, and it has been really helpful to me. I have found it does a very good job of providing both solution with the right level of detail behind so I can improve how I design and code.

So, if you have a slight grasp of python and a problem to solve, this can be quite helpful.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


‹ Previous | 1 25| Next ›
Most Helpful First | Newest First

This product

Python Cookbook
Python Cookbook by David Ascher (Paperback - July 15, 2002)
Used & New from: $4.32
Add to wishlist See buying options