'''测试Label组件的基本方法'''
from tkinter import *
class Application(Frame):#继承父类
def __init__(self,master=None):
super().__init__(master)#super代表父类的定义
self.master=master
self.pack()
self.createWidget()
def createWidget(self):
'''创建组件'''
self.label01=Label(self,text="1111",width=10,height=2,
bg="black",fg="white")
self.label01.pack()
self.label02 = Label(self, text="222", width=10, height=2,
bg="black", fg="white,font=("黑体", 33))
self.label02.pack()
if __name__=='__main__':
root=Tk()
root.geometry("400x100+200+300")
app=Application(master=root)
root.mainloop
C:\Users\pcl\venv\Scripts\python.exe "C:/Users/pcl/.1aPython all exercise/GUI/Label测试.py"
File "C:\Users\pcl\.1aPython all exercise\GUI\Label测试.py", line 23
bg="black", fg="white,font=("黑体", 33))
^
SyntaxError: invalid syntax
Process finished with exit code 1
老师 这个怎么解决 为什么视频里就能运行