from tkinter import *
def firstPage():
def goSecond():
root.destroy()
secondPage()
root = Tk()
text = Label(root, text="1")
text.pack()
btn = Button(root, text="go to 2", command=goSecond)
btn.pack()
root.mainloop()
def secondPage():
def goFirst():
root.destroy()
firstPage()
root = Tk()
text = Label(root, text="2")
text.pack()
btn = Button(root, text="go to 1", command=goFirst)
btn.pack()
root.mainloop()
firstPage()
I made this code and I want it to open a new page, but it open a new window, I understand why but I don't know how to open a page instead of open a window.
(我编写了此代码,并希望它打开一个新页面,但是它打开了一个新窗口,我知道为什么,但是我不知道如何打开页面而不是打开窗口。)
ask by Gionata Roberti translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…