thx
"Robert Oschler" <Osc...@earthlink.net> wrote in message
news:ajDm9.17019$Lg2.4...@news2.news.adelphia.net...
> is this a printed version of the Activestate Python Cookbook or is this
> something different?
It's a _vastly edited_ printed version of recipes from the online
Cookbook, with corrections and updates to the programs, much added
discussion, many additional recipes, AND fourteen chapter intros by
thirteen different authors (Tim Peters did two chapter intros). I
think the printed version (or the online one on Safari -- same thing,
though I personally prefer paper) has substantial added value wrt
the online one... or I wouldn't have spent about 9 months of my life
as a co-editor helping to make it happen (I'd have been content to
be among the most prolific contributors of recipes to the online one:-).
We had to set a cut-off date to get recipes from the online site
for the book, and of course the site has accumulated many more
recipes since (even though I didn't contribute any more there as
I was too busy with co-editing &c:-). Thus, both the book and
the site can be now considered to be "added value" wrt each other
in different ways:-).
Alex
>
> Gumuz wrote:
>
> > is this a printed version of the Activestate Python Cookbook or is this
> > something different?
>
> It's a _vastly edited_ printed version of recipes from the online
> Cookbook, with corrections and updates to the programs, much added
> discussion, many additional recipes, AND fourteen chapter intros by
> thirteen different authors (Tim Peters did two chapter intros). I
> think the printed version (or the online one on Safari -- same thing,
> though I personally prefer paper) has substantial added value wrt
> the online one... or I wouldn't have spent about 9 months of my life
> as a co-editor helping to make it happen (I'd have been content to
> be among the most prolific contributors of recipes to the online one:-).
>
> We had to set a cut-off date to get recipes from the online site
> for the book, and of course the site has accumulated many more
> recipes since (even though I didn't contribute any more there as
> I was too busy with co-editing &c:-). Thus, both the book and
> the site can be now considered to be "added value" wrt each other
> in different ways:-).
>
>
> Alex
>
You could actually leave out the code, change the title to 'The Python
Philosophy' and still have a really valuable book.
Doug Fort <doug...@dougfort.net>
http://www.dougfort.net
I agree, got the book myself :)
Python is such an easy language to learn, that there's no Python for
Dummies in publication :)
Thanks Guido.
--
Regards: Wari Wahab
http://roughingit.subtlehints.net/
Nowhere quite _as_ valuable IMHO. 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
(I hope so, at least; I'm biased, obviously:-) by showing what is
going on, what's preferable under what conditions, and so on...
Alex
regards Gerrit
there was one thing that impressed me a lot when i first started out with
Python and this newsgroup....
MY QUESTIONS WERE BEING ANSWERED BY THE PEOPLE WHO WROTE THE BOOK I HAD ON
MY LAP THAT MOMENT.
that, was sooooo cool :)
"Robert Oschler" <Osc...@earthlink.net> wrote in message
news:ajDm9.17019$Lg2.4...@news2.news.adelphia.net...
The excellent quality of the book makes it more of a problem, because
I imagine from now on all people learning Python will buy "Python
Cookbook" as one of their first Python books, and little mistakes can
be very confusing to newbies.
The book is uniformly fantastic, congratulations to the authors!
I assume the authors will keep an errata list, and fix up newer
revisions (or even reprintings?). I could look it up on O'Reiily's web
site, but perhaps the author(s) will chime in...
--
Chad Netzer
cne...@mail.arc.nasa.gov
> I love "Python Cookbook" too, but I have one small complaint. Running
> and reading some of the recipes it was clear the code in the book was
> not tested in an automated way, using something like the module
> "doctest". So there are tiny errors in variable names, etc. (I wish
<sigh> you're right -- we didn't test *all* of the code as printed (the
shame...). I _hope_ the zip you can download from O'Reilly's site with
all the fixes is better (that one is also easier for us to fix if and when
such small errors come to light).
> I had marked up my book, I cannot find the examples now.) I assume
I wish to... please do let me and/or David Ascher know about ANY
such issue you find...!
> that the code is fixed on the ActivePython site, so people who cut and
> paste from the site instead of typing will have no problem. Of
I wouldn't be quite as confident (haven't been on the site in earnest for
a while, so i don't know if Activestate's been doing any fixing, though).
> course, many of recipes are short, so a person may decide to type
> instead of cut and paste.
>
> The excellent quality of the book makes it more of a problem, because
> I imagine from now on all people learning Python will buy "Python
> Cookbook" as one of their first Python books, and little mistakes can
> be very confusing to newbies.
Indeed. Any such mistake we learn about, we can most easily fix in
a second printing (if the book is as successful as your imagination makes
it, there will be a second printing...)... it's even faster and easier to
correct them in the scripts' zipfile...
> The book is uniformly fantastic, congratulations to the authors!
Thanks! But I _do_ feel guilty about any error that may have
slipped by...:-(. I hope we can fix any such error ASAP...!!!
Alex
> On Thursday 03 October 2002 14:02, Manuel M. Garcia wrote:
>> So there are tiny errors in variable names, etc.
>
> I assume the authors will keep an errata list, and fix up newer
> revisions (or even reprintings?). I could look it up on O'Reiily's web
> site, but perhaps the author(s) will chime in...
Yes, but we can't fix what we don't know about! There's a form
on ORA's site where you can report errors, and that's the way to
be SURE your report will be gratefully acted upon -- worst case,
email is far better than nothing, though:-).
Alex
Last time I tried this (some weeks ago), it didn't work.
Is this fixed now?
Thomas
> ok, I just ordered it : D
>
> there was one thing that impressed me a lot when i first started out with
> Python and this newsgroup....
>
> MY QUESTIONS WERE BEING ANSWERED BY THE PEOPLE WHO WROTE THE BOOK I HAD ON
> MY LAP THAT MOMENT.
>
>
> that, was sooooo cool :)
This is a cool thing about this group. It happened to me back in '98
(wow, my first post here was almost 4.5 years ago...).
Cheers,
M.
--
You sound surprised. We're talking about a government department
here - they have procedures, not intelligence.
-- Ben Hutchings, cam.misc
Thomas> Alex Martelli wrote:
>> Chad Netzer wrote:
>>> I assume the authors will keep an errata list, and fix up
>>> newer revisions (or even reprintings?). I could look it up on
>>> O'Reiily's web site, but perhaps the author(s) will chime
>>> in...
>> Yes, but we can't fix what we don't know about! There's a form
>> on ORA's site where you can report errors, and that's the way
>> to be SURE your report will be gratefully acted upon -- worst
>> case, email is far better than nothing, though:-).
>>
Thomas> Last time I tried this (some weeks ago), it didn't work.
Thomas> Is this fixed now?
Maybe you need to use the form to let them know that the form isn't
working... <wink>
Tim
--
A language that doesn't affect the way you think about programming is
not worth knowing.
<snip>
Alex,
I'd like to see the book followed by an annual 'Editor's choice' update
volume. I know I'd buy them each year, hell I'd even buy a subscription.
thx
>I imagine from now on all people learning Python will buy "Python
>Cookbook" as one of their first Python books, and little mistakes can
>be very confusing to newbies.
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 (eg: 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.
>The book is uniformly fantastic, congratulations to the authors!
It is indeed that -- 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.
-- robin
You were caught, admit it, at last:
LUTHER BLISSETT IS YOU!
(Nobody expects etc. etc.)
;^)
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.
This book reminds me of the work of the late great musicologist Edward
Downs. Shortly after his death in 2001, the Metropolitan Opera ran an
appreciation of him and his work. They aired a short recording of him
explaining the terms "staccato" and "legato", terms familiar to almost all
musicians. Without being in the least condescending, he managed to convey
clearly the meanings of both terms, while adding items of interest to me,
illustrated with two gorgeous recorded examples showing the impact of the
difference between the two.
In short, this is just a superb job. It shows the power of a community of
users enhanced by the editing of stars.
Edward
--------------------------------------------------------------------
Edward K. Ream email: edr...@tds.net
Leo: Literate Editor with Outlines
Leo: http://personalpages.tds.net/~edream/front.html
--------------------------------------------------------------------
Alex
[review starts]
This book is a superbly edited collection of recipes that originally
appeared online at http://aspn.activestate.com/ASPN/Python/Cookbook/
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."
Who that say that?
I have more than 30 years of programming experience. For the last year I
have programmed exclusively in Python and tcl/tk. I am the author of a
major application written in 100% pure Python. I have benefited greatly
from the help given on comp.lang.python, often by the contributors and
editors of The Python Cookbook.
Edward K. Ream
[review ends]
Edward K. Ream wrote:
> Here is a review that I plan to submit to Amazon. It contains lightly
> edited versions of what has appeared here, so I thought I should show it
> here first for your approval.
I don't think you need anybody's approval (yes you do quote several
other people, but just brief snippets that I believe fall entirely
in the realm of "fair use" -- but admittedly I'm anything but an
expert on intellectual property law!-)... but FWIW the prospect of
such a review appearing on Amazone sure warms my heart!-)
Just one nit:
> Who that say that?
This may be an idiom that I don't recognize, but sure looks
strange to me.
Alex
It's a matter of courtesy, not of legality.
> Who that say that?
I'll revise it.
Edward
(Following the hoofprints and horse dung piles after finding an open door and
an empty stable)
Would the quotes sound more authentic with the author of each quote attached,
like you see on the back of novels?
This book is sounding better and better, its already on my birthday wishlist,
so I'd like to officially move up my birthday to next week :)
-- Misha
Nitpick: it's a "newsgroup", not an "Internet newsgroup". There are
still plenty of sites that get their news by UUCP.
--
Aahz (aa...@pythoncraft.com) <*> http://www.pythoncraft.com/
Project Vote Smart: http://www.vote-smart.org/
Yep - my birthday is in November, so I'd better start hinting about this
being on my "wantlist"... ;-) And of course, there's Nutshell which is
hopefully due before Yule... Gee, think I can get that one under the
tree?
Anna
Oh SANTA..... I've been a good girl. Really!!!
> I've just submitted a slightly revised review to Amazon.
By the way: Amazon has just reduced the price of the Cookbook
(EUR 48,12 > EUR 36,10 / $39.95 > $27.97).
Matthias
I think I paid about that for my copy from bn.com a month or so ago.
> This book is sounding better and better, its already on my birthday
> wishlist,
> so I'd like to officially move up my birthday to next week :)
I picked up a copy last week. It's definitely worth it.
--
Erik Max Francis / m...@alcyone.com / http://www.alcyone.com/max/
__ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/ \ Be able to be alone. Lose not the advantage of solitude.
\__/ Sir Thomas Browne
Kepler's laws / http://www.alcyone.com/max/physics/kepler/
A proof of Kepler's laws.
Considering that as of today a EUR is $0,9876 its quite a
difference in pricing - is this all due to taxes?
Thorsten
No, we routinely get gouged compared to US prices. Amazon UK lists it at GBP
22.80, which I make almost $36.
Still a good buy, though.
--
James Kew
jame...@btinternet.com
At least in Britain, we don't pay VAT (sales tax) on books.
(The amount more I would have spent on books in the last copule of
years if we did is, frankly, terrifying).
Cheers,
M.
--
Q: What are 1000 lawyers at the bottom of the ocean?
A: A good start.
(A lawyer told me this joke.)
-- Michael Ströder, comp.lang.python
Recipe 1.6, dispatching using a dictionary, discusses using a dictionary in
lieu of, say, a C++ switch statement. Inspired by the Cookbook, I recast
the main loop of my app’s colorizer as follows:
while i < sLen:
func = state_dict[state]
i,state = func(s,i)
This is a whole lot clearer, and probably faster than the old code. However,
it probably wouldn’t have been interesting enough to do if I hadn’t been
thinking of something more.
I was thinking of the loop above in vague way, without having written it,
and I was musing about state_dict as a (dynamic) data structure. I suddenly
thought that Python allows us to _compute_ switch statements. In fact,
this isn’t really correct: without heroic efforts we can’t really compute
the contents of state_dict. That is, it wouldn’t be worth the effort to
generate the state handlers themselves on the fly.
But the intuition behind this first (slightly erroneous) thought is correct.
We can compute _other_ data structures (dictionaries or lists) used by the
state handlers. The effect is to compute what the state handlers do.
Moreover, all the special case code that used to be in my app’s state
handlers can be moved into the computation of the dicts and lists used by
the state handlers.
Of course, this isn’t really anything new: data-driven code should be a
staple of any programmer’s repertoire. But Python makes it so much more
natural and easy to do. For example, the jEdit editor contains XML files
describing how to syntax color almost 70 different languages. I’d like my
app to be able to use those descriptions. Here is a very brief description
of what I plan to do.
The known_languages dict will contain all the data structures needed to
handle a particular language. This dict is created dynamically. Its keys
are the names of each language; its values are tuples of other data
structures. If known_languages were created statically it would look
something like:
known_languages = {
"c" : (d1,...,dn),
"python" : (d1,...,dn),
... }
The members of each tuple, i.e., d1,...,dn are created by the initialization
routine, something like this:
# Get the data structures for language, the language to be colored.
data = known_languages.get(language)
if not data:
# Parse the description file, creating the data structures.
data = parse_xml_file(language)
if data: known_languages[language] = data
if data:
# unpack the data for convenience of the state handlers.
d1,...,dn=data
Actually, most of the methods and data would be members of the colorizing
class, and I’ve omitted all the "self" prefixes for clarity.
This is about as elegant description of the problem as can be imagined. It
rivals mathematical notation in its conciseness, power and generality, while
being real Python code, except for the ellipses. It doesn’t get much better
than this.
Edward
P.S. In theory, this scheme could be transliterated into C or C++. In
practice, few C++ programmers would discover it: the implementation details
would obscure everything, especially the thoughts that lead to the scheme in
the first place.
EKR
Just submitted mine.
thx (Silly Viking)
I just wanted to say 'thanks' to Alex for all his high-bandwidth, good
signal-to-noise postings on this group (and others). I've learned a
lot by by reading them.
Of course, this book is the work of lots of other people too, most of
which I guess post here too. c.l.py as a whole really is full of
knowledgeable, friendly people. Gee, aren't we all wonderful?
Must get a copy some time...
John
> "Edward K. Ream" <edr...@tds.net> wrote in message
> news:<ixep9.16627$PS1.1...@kent.svc.tds.net>...
>> > Got the book 2 weeks ago, what a treasure trove. If you are serious
>> > about Python then get this book.
> [...]
>> In short, this is just a superb job. It shows the power of a community
>> of users enhanced by the editing of stars.
>
> I just wanted to say 'thanks' to Alex for all his high-bandwidth, good
> signal-to-noise postings on this group (and others). I've learned a
> lot by by reading them.
You're MOST welcome (if anybody thought I could ignore a post with
THIS subject, it only shows they really don't know me well!-).
> Of course, this book is the work of lots of other people too, most of
> which I guess post here too. c.l.py as a whole really is full of
> knowledgeable, friendly people. Gee, aren't we all wonderful?
And that's the really important point in my opinion (and the one that
gave me a reasonable excluse to reply in this thread:-) -- the Cookbook
*IS* the Python Community's book. That's not quite the same thing as
c.l.py -- we can't all be posting or even following all of the time
(me, I'm rushing to catch up after two weeks' absence -- and next week
I'm away again, sigh...) -- but of course there is a lot of overlap.
Yes, David Ascher and I did do a lot of editing, and O'Reilly's editors
provided indispensable guidance and hard work too, but one of our main
challenges was to make the book readable as a unified whole WITHOUT
making all of the many, different "voices" in the book sound "the same".
With over a hundred recipe contributors, and over a dozen authors of
chapter introductions (each a mini-essay in its own right), providing
so much high-quality "raw material", "the power of a community of users"
is indeed alluringly displayed -- as long as we've done our "squaring
the circle" job of "unifying without homogeinizing". It seems that to
some extent we have, and if we've come anywhere close to doing justice
to this wonderful community then I'm really glad of all that hard work.
> Must get a copy some time...
Make sure you mention it in your letter to Santa - it should make
a rather neat stocking-filler!-)
Alex