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