This Book’s Structure

Although code examples are reused throughout the book and later chapters build upon material in earlier chapters (e.g., GUIs), topics in this book are covered fairly independently and are grouped together in different parts. If a particular domain’s part doesn’t interest you, you can generally skip ahead to a part that does.

As a result, it’s not too much of a stretch to consider this edition as akin to four or five books in one. Its top-level structure underscores its application-topics focus (see the Table of Contents for a more fine-grained look at the book’s structure):

Part I, The Beginning

I start off with an overview of some of the main ideas behind Python and a quick sneak-preview chapter to whet your appetite. The sneak preview doesn’t teach much, but it serves as an introduction and demo for some of the topics to come, and as a refresher for core Python concepts such as OOP.

Part II, System Programming

This section explores the system-level interfaces in Python as well as their realistic applications. We’ll look at topics such as threading, directory walkers, processes, environment variables, and streams, and we will apply such tools to common system administration tasks such as directory searchers and file splitters.

Part III, GUI Programming

In this section, you’ll learn how to build portable GUIs with Python. The Tkinter toolkit is covered from the ground up as you move from basics to techniques to constructing complete programs. You’ll build text editors, clocks, and more in this part. GUIs also show up throughout the rest of the book, and they often reuse some of the tools you’ll build here.

Part IV, Internet Programming

In this section, you’ll learn all about using Python on the Internet. I begin with network basics and sockets, move through client-side tools like FTP and email, and end up using server-side tools to implement interactive web sites. Along the way, I’ll contrast different ways to move bits around the Web with Python. You’ll code GUI and web-based email programs, for example, to help underscore trade-offs between client- and server-side techniques. A final chapter in this part surveys more advanced toolkits and techniques for Internet-related application development—Zope, Jython, XML, and the like.

Part V, Tools and Techniques

This part is a collection of tool topics that span application domains—database interfaces and object persistence, text and language processing, and data structure implementation. You’ll build GUIs here for browsing databases, viewing data structures, and performing calculations.

Part VI, Integration

This part of the book looks at the interfaces available for mixing Python with programs written in C and C++. These interfaces allow Python to script existing libraries and to serve as an embedded customization tool. As you’ll see, by combining Python with compiled languages, programs can be both flexible and efficient.

Part VII, The End

Finally, I’ll wrap up with a conclusion that looks at some of the implications of Python’s scripting role.

Two notes about the structure: first of all, don’t let these titles fool you—although most have to do with application topics, Python language features and general design concepts are still explored along the way, in the context of real-world goals. Secondly, readers who use Python as a standalone tool can safely skip the integration part, though I still recommend a quick glance. C programming isn’t nearly as fun or as easy as Python programming is. Yet, because integration is central to Python’s role as a scripting tool, a cursory understanding can be useful, regardless of whether you do integrating, scripting, or both.

Get Programming Python, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.