tomaslin 发表于 2020-3-12 17:04:55

导入Tkinter后label组件功能无法使用:NameError: name 'Lable' is not defined

百度搜索了一下貌似大家都没有遇到过这个问题,特发帖求助!!
源代码:
from tkinter import *
root=Tk()
textLable=Lable(root,text='the film you download contains forbiden content for teenages, pls see it when you are older than 18')
textLable.pack(side=LEFT)

photo=PhoteImage(file='18.jpg')
imgLable=Lable(root,image=photo)
imgLable.pack(side=RIGHT)

mainloop()

tomaslin 发表于 2020-3-12 17:07:10

完整的报错信息:
Traceback (most recent call last):
File "F:/python learning/tk3.py", line 3, in <module>
    textLable=Lable(root,text='the film you download contains forbiden content for teenages, pls see it when you are older than 18')
NameError: name 'Lable' is not defined

dlnb526 发表于 2020-3-12 17:14:20

您好,tkinter里对应的函数为Label.请检查哦

tomaslin 发表于 2020-3-13 10:44:36

dlnb526 发表于 2020-3-12 17:14
您好,tkinter里对应的函数为Label.请检查哦

谢谢,犯了好低级的错误却没发现{:5_100:}
页: [1]
查看完整版本: 导入Tkinter后label组件功能无法使用:NameError: name 'Lable' is not defined