python的图形化编程方法

刚刚开始接触图形化编程,记录一下

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="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()

  

posted @ 2018-05-17 09:38  小宇先森  阅读(2689)  评论(0编辑  收藏  举报