GUI编程
运行示例
from tkinter
import *
class Application(Frame):
def __init__(self, master = None):
Frame.__init__(self, master)
self.pack()
self.createWidgets()
def createWidgets(self):
self.helloLabel = Label(self, text=
"你好,Python")
self.helloLabel.pack()
self.nameInput = Entry(self)
self.nameInput.pack()
self.quitButton = Button(self, text=
"退出", command = self.quit)
self.quitButton.pack()
app = Application()
app.master.title(
"Tkinter 示例")
app.mainloop()