I am trying to make a slide show and have all of the image paths stored in 1 text file to make the main code a bit cleaner, here is the main code :
import tkinter as tk
from itertools import cycle
from PIL import ImageTk, Image
images = open('list.txt', 'r').read()
print(images)
photos = cycle(ImageTk.PhotoImage(Image.open(image)) for image in images)
def slideShow():
img = next(photos)
displayCanvas.config(image=img)
root.after(1200, slideShow)
root = tk.Tk()
root.overrideredirect(True)
width = root.winfo_screenwidth()
height = root.winfo_screenwidth()
root.geometry('%dx%d' % (1600, 900))
displayCanvas = tk.Label(root)
displayCanvas.pack()
root.after(1000, lambda: slideShow())
root.mainloop()
and here is a download for the list file, in case it needs reformatting or something: https://drive.google.com/open?id=17PzCCf6DK9L-8q4ZxVe7bPD1kFlIuZts
I currently get this error when I try to run the code
FileNotFoundError: [Errno 2] No such file or directory: '['
I have tried formatting it in different ways, nothing worked it all just had whatever the first character was and then "no such file or directory"