I tried to make a Python Tkinter window which opens another Tkinter Window but for some reason in the second window no image shows up and this error message is there:
image "pyimage1" doesn't exist
How can I fix this?
import tkinter as tk
from tkinter import ttk
from PIL import Image, ImageTk
import time
def startnew():
imagetest = Image.open("test.png").resize((1000, 620))
phototest = ImageTk.PhotoImage(imagetest)
test = tk.Tk()
test.geometry("1000x620")
testlabel = ttk.Label(test, image=phototest)
testlabel.place(x=-2, y=-2)
microsoft = tk.Tk()
microsoft.geometry("1000x620")
microlabel = ttk.Label(microsoft)
microabel.place(x=-2, y=-2)
button = tk.Button(microsoft, text="plzhelp", command=startnew)
button.place(x=100, y=100)
tk.mainloop()
I know there are posts with the same error but I cant understand them because their projects are complex