Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

Share this Page URL
Help

Chapter 8. A Tkinter Tour, Part 2 > The End of the Tour - Pg. 411

The End of the Tour And that's a wrap for our tour around the Tkinter library. You have now seen all the widgets and tools previewed at the end of Chapter 6 (flip back for a summary of territory covered on this tour). For more details, watch for all of the tools introduced here to appear again in larger GUI examples in Chapter 9, and the remainder of the book at large. And consult Tk and Tkinter resources for options not listed explicitly here; al- though other Tkinter options are analogous to those presented on this tour, the space I have for illustrating such options in this book is limited by both my publisher and my fingers. The PyDemos and PyGadgets Launchers To close out this chapter, I want to show 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 Chapter 8 and Chapter 3: · 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 Examples Example 3-24, Example 4-14, and Example 4-15 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 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 PP2E examples root directory. These scripts could allow invocations from other directories by prepending the PP2EHOME environment variable's value to pro- gram script paths, but they were really only designed to be run out of the PP2E root. PyDemos Launcher Bar The PyDemos script constructs a bar of buttons that run programs in demonstration mode, not for day-to-day use. I use PyDemos to show off Python programs whenever I can -- it's much easier to press its buttons than to run command lines or fish through a file explorer GUI to find scripts. You should use PyDemos to start and interact with examples presented in this book -- all of the buttons on this GUI represent examples we will meet in later chapters. The PyDemos and PyGadgets Launchers | 411