Book Image

Python Essentials

By : Steven F. Lott
Book Image

Python Essentials

By: Steven F. Lott

Overview of this book

Table of Contents (22 chapters)
Python Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Building GUI applications


We can differentiate between applications which merely work with graphics and applications which are deeply interactive. In the first case, we might have a command-line application which creates or modifies image files. In the second case, we'll define an application which responds to input events. These interactive applications create an event loop which accepts mouse clicks, screen gestures, keyboard characters, and other events, and responds to those events. In some respects, the only unique feature of a GUI program is the wide variety of events it responds to.

The tkinter module is an interface between Python and the Tk user interface widget toolkit. This module helps us build richly interactive applications. When we use Python's built-in IDLE editor, we're using an application that was built with tkinter. The tkinter module documentation includes background information on the Tk widgets.

The turtle module also depends on the underlying Tk graphics. This module...