我遵循了python 3的教程,但使用的是python 2。在教程中使用了以下代码:
button2 = ttk.Button(self, text="Disagree", command = quit)当我运行代码时,我得到了错误:
NameError: global name 'quit' is not defined在python2中有没有可以使用的等效函数?我尝试了sys.exit(),但它冻结了tkinter窗口,而不仅仅是关闭它。
发布于 2015-07-17 05:28:53
Tkinter想要root.quit()。(root是根Tkinter对象)
https://stackoverflow.com/questions/31464426
复制相似问题