CHAPTER 1
A Sneak Preview
“Programming Python: The Short Story”
If you are like most people, when you pick up a book as large as this one, you’d like to
know a little about what you’re going to be learning before you roll up your sleeves.
That’s what this chapter is for—it provides a demonstration of some of the kinds of
things you can do with Python, before getting into the details. You won’t learn the full
story here, and if you’re looking for complete explanations of the tools and techniques
applied in this chapter, you’ll have to read on to later parts of the book. The point here
is just to whet your appetite, review a few Python basics, and preview some of the topics
to come.
To do this, I’ll pick a fairly simple application task—constructing a database of
records—and migrate it through multiple steps: interactive coding, command-line
tools, console interfaces, GUIs, and simple web-based interfaces. Along the way, we’ll
also peek at concepts such as data representation, object persistence, and object-
oriented programming (OOP); explore some alternatives that we’ll revisit later in the
book; and review some core Python ideas that you should be aware of before reading
this book. Ultimately, we’ll wind up with a database of Python class instances, which
can be browsed and changed from a variety of interfaces.
I’ll cover additional topics in this book, of course, but the techniques you will see here
are representative of some of the domains we’ll explore later. And again, if you don’t
completely understand the programs in this chapter, don’t worry because you
shouldn’t—not yet anyway. This is just a Python demo. We’ll fill in the rest of the
details soon enough. For now, let’s start off with a bit of fun.
3
Do
wnload from Wow! eBook <www.wowebook.com>