我目前正在学习 python tkinter,并且有一个关于使用显式代码退出 tkinter 窗口的问题。到目前为止,这是我的代码(我已将其简化以仅关注问题)
from tkinter import *
def DoSomething():
pass
root = Tk()
men = Menu(root)
root.config(menu = men)
submenu = Menu(men)
men.add_cascade(label = "File",menu = submenu)
submenu.add_command(label = "quit",command = Menu.quit)#Window does not close when user clicks "quit",
it just
stays there non-responding
root.mainloop()
Run Code Online (Sandbox Code Playgroud)
任何与此相关的帮助将不胜感激。谢谢