- Chapters 8 and 9 take you on a tour of the tkinter widget set.* Roughly, Chap-
ter 8 presents simple widgets and Chapter 9 covers more advanced widgets and
related tools. Most of the interface devices you’re accustomed to seeing—sliders,
menus, dialogs, images, and their kin—show up here. These two chapters are not
a fully complete tkinter reference (which could easily fill a large book by itself), but
they should be enough to help you get started coding substantial Python GUIs.
The examples in these chapters are focused on widgets and tkinter tools, but Py-
thon’s support for code reuse is also explored along the way. - Chapter 10 covers more advanced GUI programming techniques. It includes an
exploration of techniques for automating common GUI tasks with Python. Al-
though tkinter is a full-featured library, a small amount of reusable Python code
can make its interfaces even more powerful and easier to use. - Chapter 11 wraps up by presenting a handful of complete GUI programs that make
use of coding and widget techniques presented in the four preceding chapters.
We’ll learn how to implement text editors, image viewers, clocks, and more.
Because GUIs are actually cross-domain tools, other GUI examples will also show up
throughout the remainder of this book. For example, we’ll later see complete email
GUIs and calculators, as well as a basic FTP client GUI; additional examples such as
tree viewers and table browsers are available externally in the book examples package.
Chapter 11 gives a list of forward pointers to other tkinter examples in this text.
After we explore GUIs, in Part IV we’ll also learn how to build basic user interfaces
within a web browser using HTML and Python scripts that run on a server—a very
different model with advantages and tradeoffs all its own that are important to under-
stand. Newer technologies such as the RIAs described later in this chapter build on the
web browser model to offer even more interface choices.
For now, though, our focus here is on more traditional GUIs—known as “desktop”
applications to some, and as “standalone” GUIs to others. As we’ll see when we meet
FTP and email client GUIs in the Internet part of this book, though, such programs
often connect to a network to do their work as well.
- The term “widget set” refers to the objects used to build familiar point-and-click user interface devices—
push buttons, sliders, input fields, and so on. tkinter comes with Python classes that correspond to all the
widgets you’re accustomed to seeing in graphical displays. Besides widgets, tkinter also comes with tools for
other activities, such as scheduling events to occur, waiting for socket data to arrive, and so on.
356 | Chapter 7: Graphical User Interfaces