python tk 的奇怪错误
class Application(tk.Frame):
def __init__(self,master=None):
tk.Frame.__init__(self,master)
self.pack()
self.createWidgets()
def createWidgets(self):
self.end=tk.Button(self,text="end",fg="red",command=self.end)
self.end.pack(side="bottom")
self.start=tk.Button(self)
self.start["text"]="start"
self.start["command"]=self.start
self.start.pack(side="top")
def start(self):
print("start button clicked!")
def end(self):
print("end button clicked!")
root=tk.Tk()
app=Application(master=root)
app.mainloop()