I'm doing a project for school and I have no clue as to why this isn't working. Any help is appreciated!
from tkinter import *
def main():
def change():
photo2 = PhotoImage(file=r"image2")
label.configure(image = photo2)
mainwindow.destroy()
window = Tk()
window.geometry("1500x1500")
photo1 = PhotoImage(file = r"image1")
label = Label(window, image = photo1)
label.place(x = 20, y = 20)
button = Button(window, text = "Click Me!", command = change)
button.place(x = 0, y = 0)
window.mainloop()
mainwindow = Tk()
mainwindow.geometry("700x700")
start = Button(mainwindow, text = "start", command = main)
start.place(x = 0, y = 0)
mainwindow.mainloop()