#测试Lable
from tkinter import *
class Application(Frame): #Application通常指GUI程序的意思,也可以起别的名字
def __init__(self,master=None):
super().__init__(master)
self.master=master
self.pack()
self.creatWidget()
def creatWidget(self): #创建更多的组建
self.label01=Label(self,text='baizhan',width=10,height=2,bg='black',fg='white')
self.label01.pack()
self.label02=Label(self,text='IT',width=10,height=2,bg='blue',fg='white',font('黑体',30))
self.label02.pack()
if __name__=='__main__':
root=Tk()
root.geometry('400x200+200+300')
app=Application(master=root)
root.mainloop() #调用组建,进入事件循环

老师好,这个报错是因为参数位置的不正确吗?
我把17、18行改成注释之后是可以运行的,但是加上之后就会报错