How to do it...

First, we will create a working GUI that shuffles slides within a window frame using pure Python. Here is the working code and some screenshots of the results of running this code:

from tkinter import Tk, PhotoImage, Label from itertools import cycle from os import listdir class SlideShow(Tk):     # inherit GUI framework extending tkinter     def __init__(self, msShowTimeBetweenSlides=1500):         # initialize tkinter super class         Tk.__init__(self)         # time each slide will be shown         self.showTime = msShowTimeBetweenSlides         # look for images in current working directory          listOfSlides = [slide for slide in listdir()                         if slide.endswith('gif')]         # cycle slides to show on the tkinter Label   self.iterableCycle = cycle((PhotoImage(file=slide), ...

Get Python GUI Programming Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.