Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在制作一个 GUI,并想添加一个退出按钮来关闭窗口。唯一的问题是,当我使用以下代码添加按钮时:
root = Tk()
Exit = Button(root, text = "Quit", command = root.quit()).grid(row = 6, column = 1)
GUI 窗口崩溃。我正在运行 Windows 7 和 Python 3.2。
尝试这个:
root = Tk() Exit = Button(root, text = "Quit", command = root.quit).grid(row = 6, column = 1)
在 root.quit() 我去掉了括号。看看能不能解决问题