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

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM