i am currently receiving images stored in database from their url after retrieving them and storing them in a file i need to show them on an GUI with python while the code is running (at the last image they should repeat) i used tkinter library but i am facing a problem that the GUI shows only the last image here is the code:
def resize_image(event):
new_width = event.width
new_height = event.height
image = copy_of_image.resize((new_width, new_height))
photo = ImageTk.PhotoImage(image)
label.config(image = photo)
label.image = photo
for images in os.listdir(r"C:\Users\Ali\Desktop\imgs"):
im = Image.open(images)
copy_of_image = im.copy()
photo = ImageTk.PhotoImage(im)
label = ttk.Label(root, image = photo)
label.bind('<Configure>', resize_image)
label.pack(fill=BOTH, expand = YES)
root.mainloop()
any suggestions for this problem please