pythonにおけるGUI,LabelとButtonの実例について詳しく説明する。
以下の通りです
#coding=utf-8
import Tkinter
top=Tkinter.Tk()
#400x300: ,300,100
#x: x
top.geometry('400x300+300+100')
# , “hello world”
lab=Tkinter.Label(top,text='hello world')
#
lab.pack()
#
button=Tkinter.Button(top,text='quit',command=top.quit,bg='red',fg='orange')
#expand 1 fill
#expand 0 fill
#fill=X GUI ,widget X GUI
#fill=Y GUI ,widget Y GUI
#fill=BOTH GUI ,widget X、Y GUI
button.pack(fill=Tkinter.X,expand=1)
#
Tkinter.mainloop()
以上のpythonのGUIに対して、LabelとButtonの実例の詳しい解は小編集が皆さんに提供した内容の全部です。参考にしてほしいです。どうぞよろしくお願いします。