Functions in Tkinter
问题 So I am practicing using Tkinter with python, and I am just trying to learn the basics. My code right now is import Tkinter as tk class Example(tk.Frame): def __init__(self, parent): tk.Frame.__init__(self, parent) self.prompt = tk.Label(self, text="Press a button", anchor="w") self.button1 = tk.Button(self, text="Button 1", command = self.button1) self.button2 = tk.Button(self, text="Button 2", command = self.button2) self.output = tk.Label(self, text="") # lay the widgets out on the screen.