Dec-29-2020, 07:50 PM
I cant seem to find the right way to make a random image appear in a window (im using tk for the window), so every second a new random image from a folder appears. Haven't found a tutorial that works. this is what ive got so far but dont know how to display the image in the window:
just for reference, Im using python3 on Linux
import os from Tkinter import * from PIL import ImageTk, Image import random #the window window=Tk() window.title('Johnny') window.geometry("300x200+10+20") window.configure(background='black') # end of window settings, content goes next: count = 1 while count < 20: path="/home/david/Desktop/Johnny/Assets" files=os.listdir(path) d=random.choice(files) window.mainloop()any help would be very appreciated!
just for reference, Im using python3 on Linux