from TKinter import *
class Ui(Frame):
def __init__(self)
Frame.__init__(self, None)
self.grid()
bquit=Button(self, text="Quit", command=self.quit_pressed)
bquit.grid(row=0, column=0)
def quit_pressed(self):
self.destroy()
app=Ui()
app.mainloop()
爲什麼Tkinter程序在我按下「退出」按鈕時無法正常結束?Python Tkinter應用程序不能正常退出
你在使用IDLE嗎? – 2011-05-06 19:36:09
不使用IDLE。 – jldupont 2011-05-06 19:37:44