曲速飞跃 发表于 2020-8-1 14:23:33

Python中tkinter莫名其妙报错

Exception in Tkinter callback
Traceback (most recent call last):
File "C:\\Users\\Charlie\\AppData\\Local\\Programs\\Python\\Python38\\lib\\tkinter\\__in
it__.py", line 1883, in __call__
    return self.func(*args)
File "D:\\my.code\\小甲鱼.py", line 26, in sleep
    imgLabel = Label(root, image=photo)
File "C:\\Users\\Charlie\\AppData\\Local\\Programs\\Python\\Python38\\lib\\tkinter\\__in
it__.py", line 3143, in __init__
    Widget.__init__(self, master, 'label', cnf, kw)
File "C:\\Users\\Charlie\\AppData\\Local\\Programs\\Python\\Python38\\lib\\tkinter\\__in
it__.py", line 2567, in __init__
    self.tk.call(
_tkinter.TclError: image "pyimage2" doesn't exist

zltzlt 发表于 2020-8-1 14:23:42

发代码

Twilight6 发表于 2020-8-1 14:26:11



发完整代码吧,你这里错误应该是代码中存在多个 Tk() 根窗口 ,或者 mainloop() 了

曲速飞跃 发表于 2020-8-1 14:35:38

谢谢!问题已解决了
页: [1]
查看完整版本: Python中tkinter莫名其妙报错