<jupyter_start><jupyter_text>From https://stackoverflow.com/questions/60477816/how-to-create-a-fast-slideshow-in-python<jupyter_code>import tkinter as tk
import sys


class Application(tk.Tk):

    def __init__(self, *args, **kwargs):
        tk.Tk.__init__(self, *args, **kwargs)

        self.title("Slideshow")
        self.geometry("256x256")
        self.resizable(width=False, height=False)
        self.current_slide = tk.Label(self)
        self.current_slide.pack()
        self.duration_ms = 1000

    def set_image_directory(self, path):
        from pathlib import Path
        from PIL import Image, ImageTk
        from itertools import cycle

        image_paths = Path(path).glob("*.jpg")
        self.images = cycle(zip(map(lambda p: p.name, image_paths), map(ImageTk.PhotoImage, map(Image.open, image_paths))))

    def display_next_slide(self):
        name, self.next_image = next(self.images)
        self.current_slide.config(image=self.next_image)
        self.title(name)
        self.after(self.duration_ms, self.display_next_slide)

    def start(self):
        self.display_next_slide()

def main():

    application = Application()
    application.set_image_directory("/images-originals/")
    application.start()
    application.mainloop()


if __name__ == "__main__":
    sys.exit(main())<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12388724035608309, 'fraction_numerical': 0.013353115727002967, 'mean_word_length': 3.323717948717949, 'pattern_counts': {'":': 1, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '651715', 'license': 'CC0-1.0', 'n_tokens_mistral': 455, 'n_tokens_neox': 432, 'n_words': 74, 'path': 'slideshow_v1.ipynb', 'repo_name': 'trucabrac/Blob-process---tests', 'size': '1348'}