I wrote a restart program but it does not work
retry = Button(text="play again", width=11, bg="black", fg="grey99", command=restart)
retry.pack()
And the restart function is below
def restart():
global window
window.destroy() # destroy and create a new one
window = Tk()
global screenheight
global screenwidth
screenwidth = window.winfo_screenwidth()
screenheight = window.winfo_screenheight()
window.geometry("{0}x{1}+0+0".format(window.winfo_screenwidth(), window.winfo_screenheight()))
window.title("Predict future")
canvas = Canvas(window, width=screenwidth, height=screenwidth, bg="ghost white")
canvas.place(x=500, y=300)
taiji = PhotoImage(file="taiji.gif")
taijitu = Label(image=taiji)
intro = Button(window, image=taijitu, command=New)
intro.place(x=-120, y=-60)
So it just destroys the old one and creates a new window, but the photo image doesn't show up (I guess it had been garbage collected).