1、代码
from tkinter import *
root = Tk()
root.wm_title('the first lable')
label = Label(root, text = 'this is a label')
label.pack()
root.mainloop()
2、运行结果
3、标签属性
4、属性实例
from tkinter import *
root = Tk()
root.wm_title('the first lable')
label = Label(root, text = 'this is a label', bg = 'green', bd = '5', width = 20)
label.pack()
root.mainloop()