Skip to Main Content
Programming Python, 3rd Edition
book

Programming Python, 3rd Edition

by Mark Lutz
August 2006
Intermediate to advanced content levelIntermediate to advanced
1600 pages
51h 46m
English
O'Reilly Media, Inc.
Content preview from Programming Python, 3rd Edition

The PyDemos and PyGadgets Launchers

To close out this chapter, let’s explore the implementations of the two GUIs used to run major book examples. The following GUIs, PyDemos and PyGadgets, are simply GUIs for launching other GUI programs. In fact, we’ve now come to the end of the demo launcher story—both of the programs here interact with modules that we met earlier in Chapters 5 and 6:

launchmodes.py

Starts independent Python programs portably.

Launcher.py

Finds programs, and ultimately runs both PyDemos and PyGadgets when used by the self-configuring top-level launcher scripts.

LaunchBrowser.py

Spawns web browsers.

See Example 5-25 in Chapter 5, and Examples 6-14 and 6-15 in Chapter 6, for the code for these modules. The programs listed here add the GUI components to the program-launching system—they simply provide easy-to-use pushbuttons that spawn most of the larger examples in this text when pressed.

Both of these scripts also assume that they will be run with the current working directory set to their directory (they hardcode paths to other programs relative to that). Either click on their names in a file explorer or run them from a command-line shell after a cd to the top-level PP3E examples root directory. These scripts could allow invocations from other directories by prepending the PP3EHOME environment variable’s value to program script paths, but they were really designed to be run only out of the PP3E root.

PyDemos Launcher Bar

The PyDemos script constructs a bar of buttons that ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Python, 3rd Edition

Learning Python, 3rd Edition

Mark Lutz

Publisher Resources

ISBN: 0596009259Supplemental ContentErrata Page