您的位置:首页 > 编程语言 > Python开发

Python的GUI简单介绍

2016-03-17 14:52 701 查看

下面是利用python自带的tkinter做的一个widiget.

from tkinter import *
class MainWidiget(Frame):
def __init__(self,master = None):
super().__init__(master)
self.pack()
self.createwidiget()
def createwidiget(self):
self.helloLabel = Label(self, text='Hello, world!')
self.helloLabel.pack()
self.quitButton = Button(self, text='Quit', command=self.quit)
self.quitButton.pack()
m = MainWidiget()
m.master.title('hello,world')
m.mainloop()
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: