A picture may be worth a thousand words, but it takes considerably fewer to display one with Python. The next program, PyView, implements a simple photo slideshow program in portable Python/tkinter code. It doesn’t have any image-processing abilities such as PyPhoto’s resizing, but it does provide different tools, such as image note files, and it can be run without the optional PIL extension.
PyView pulls together many of the topics we studied in Chapter 9: it uses
after events to sequence a slideshow,
displays image objects in an automatically sized canvas, and so on.
Its main window displays a photo on a canvas; users can either open
and view a photo directly or start a slideshow mode that picks and
displays a random photo from a directory at regular intervals
specified with a scale widget.
By default, PyView slideshows show images in the book’s image file directory (though the Open button allows you to load images in arbitrary directories). To view other sets of photos, either pass a directory name in as a first command-line argument or change the default directory name in the script itself. I can’t show you a slideshow in action here, but I can show you the main window in general. Figure 11-12 shows the main PyView window’s default display on Windows 7, created by running the slideShowPlus.py script we’ll see in Example 11-6 ahead.
Figure 11-12. PyView without notes
Though it’s not obvious as rendered in this book, the black-on-red ...