上天入地 唯我独尊
2021-12-16 16:17
采纳率: 50%
浏览 96

python如何在canvas中加入图片

Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Program Files (x86)\Python38-32\lib\tkinter_init_.py", line 1883, in call
return self.func(*args)
File "C:\桌面\srtp.py", line 79, in direction
im=ImageTk.PhotoImage(image)
File "C:\Program Files (x86)\Python38-32\lib\site-packages\PIL\ImageTk.py", line 112, in init
self.photo = tkinter.PhotoImage(**kw)
File "C:\Program Files (x86)\Python38-32\lib\tkinter_init_.py", line 4061, in init
Image.init(self, 'photo', name, cnf, master, **kw)
File "C:\Program Files (x86)\Python38-32\lib\tkinter__init
.py", line 3994, in init
raise RuntimeError('Too early to create image')
RuntimeError: Too early to create image

2条回答 默认 最新

相关推荐 更多相似问题