In addition to the people I mentioned in the first edition's
preface, I'd like to extend appreciation to a few of the people
who helped in some way during this second edition project:
To this book's first editor, Frank Willison, for overseeing
this update, as well as championing the Python cause at
O'Reilly and beyond. To this book's later editor, Laura
Lewin, for picking up the ball and lighting necessary fires.
To Python creator Guido van Rossum for making this stuff fun again.
To the people who took part in a review of an early draft of this
edition: Eric Raymond, Mark Hammond, David Ascher, Tim Peters, and
To Tim O'Reilly and the staff of O'Reilly &
Associates, both for producing this book, and supporting open source
software in general.
To the Python community at large, for diligence, hard work, and
humor -- both in the early years and today. We've come far,
but to steal a line from the 1970s: You aint' seen
And to the students of the many Python classes I have taught, as well
as the scores of readers who took the time to send me comments about
the first edition; your opinions helped shape this update.
Finally, a few personal notes of thanks. To my children, Michael,
Samantha, and Roxanne, for purpose. If they are at all representative
of their generation, the future of our species seems in very good
hands. You'll have to pardon me if that sounds proud; with kids
like mine, it's impossible to feel otherwise.
And most of all to Lisa, the mother of those amazing kids. I owe her
my largest debt of gratitude, for everything from enduring my flights
from reality while writing books like this, to keeping me out of jail
in our youth. No matter what the future may hold, I'll always
be glad that something threw us together two decades ago.
- Mark Lutz
- November 2000
- Somewhere in Colorado
The last five years have also been host to the rise of the open
source movement. Open source refers to software that is distributed
free of charge with full source code, and is usually the product of
many developers working in a loosely knit collaborative fashion.
Python, the Linux operating system, and many other tools such as Perl
and the Apache web server fall into this category. Partly because of
its challenge to the dominance of mega-companies, the open source
movement has quickly spread through society in profound ways.
Let me tell you about an event that recently underscored the scope of
this movement's impact on me. To understand this story, you
first need to know that as I was writing this book, I lived in a
small town in Colorado not generally known for being on the cutting
edge of technological innovation. To put that more colorfully,
it's the sort of place that is sometimes called a "cowboy
I was at a small local bookstore hunting for the latest
Linux Journal. After browsing for a while, I
found a copy and walked it to the checkout. Behind the counter were
two clerks who looked as if they might be more at home at a rodeo
than behind the counter of this establishment. The older of the two
sported gray hair, a moustache, and the well-worn skin of a person
accustomed to life on a ranch. Both wore obligatory baseball caps.
Cowboys, to be sure.
As I put the magazine down, the elder clerk looked up for a moment,
and said, in classic cowboy drawl, "Linux, huh? I tell you
what, when Billy goes down, he's goin' down fast!"
Of course, this was in reference to the widely publicized competition
between Linux and Bill Gates' Microsoft Windows, spurred by the
open source movement.
Now, in another time and place, these two might have instead been
discussing livestock and firearms over strong cups of coffee. Yet
somehow, somewhere, they had become passionate advocates of the Linux
open source operating system. After collecting my chin from the
floor, we wound up having a lively discussion about Linux, Microsoft,
Python, and all things open. You might even say we had a good-old
I'm not trying to express a preference for one operating system
over another here; both have merits, and Python runs equally well on
either platform (indeed, this book's examples were developed on
both systems). But I am amazed that an idea that software developers
often take for granted has had such a deep, mainstream impact. That
seems a very hopeful thing to me; if technology is to truly improve
the quality of life in the next millennium, we need all the cowboys
we can get.