I am building a small diary that includes pictures. I want to arrange those pictures in a single column. When I run the code below, the first picture appears. Pressing Enter, the second picture appears but the previous one disappears and so on until the last picture. Notice that the 'Press Enter to continue' will not be part of the code. It is there to trigger the posting of the picture. So does the Print(image). It shows the files being processed.
import tkinter as tk
from tkinter import *
from tkinter import ttk
from tkinter import Frame, Menu
from PIL import Image, ImageTk
import os
root = tk.Tk()
root.geometry('750x1000')
root.resizable(0,0)
root.columnconfigure(0, weight=5)
root.columnconfigure(1, weight=5)
root.columnconfigure(2, weight=5)
photo_list = []
photo_list = ['zendo1.png','hadock2.png','moon.png','sun.png','sailboat-sunset.png']
n=0
i=0
j=0
while n < 5:
img=Image.open(photo_list[n])
img= img.resize((150,150),Image.ANTIALIAS)
image=img
photoImg = ImageTk.PhotoImage(image)
photo_label= Label(root, image = photoImg)
print (image)
photo_label.grid(row=i, column=j)
verif_step = input("Please Press Enter to Continue ")
i=i+1
#j=j+1
n += 1
root.mainloop()
I tried with 'While' and 'For', plus looking up previous posts dealing with the same issue. But no cigar...