from tkinter import *
class Application(Frame):
def __init__(self, master=None):
Frame.__init__(self, master)
self.pack()
self.createWidets()
def createWidets(self):
self.helloLabel = Label(self, text='Hello ,world!')
self.helloLabel.pack()
self.quitButton = Button(self, text='Quit', command = self.quit)
self.quitButton.pack()
app = Application()
#设置窗口标题
app.master.title('Hello World')
#主消息循环
app.mainloop()
Python基础之十一图像界面
最新推荐文章于 2022-05-14 18:12:25 发布