我正在与graphics.py
. 它是 Tkinter 的基于基本功能的“简单”衍生物
我正在开发一款游戏,如果我尝试 undraw() 方法,我会收到此错误
由于隐私问题,代码已被删除
完整追溯:
Exception in Tkinter callback Traceback (most recent call last):
File "C:\Python33\lib\tkinter\__init__.py", line 1442, in __call__
return self.func(*args) File "C:\Users\Benny\Google Drive\PSAP\Assignments\Assignment_2_PSP\Assignment_2_Part2\Assign2_Part2.py",
line 38, in handleKeys
play_game() File "C:\Users\Benny\Google Drive\PSAP\Assignments\Assignment_2_PSP\Assignment_2_Part2\Assign2_Part2.py",
line 100, in play_game
i.undraw() File "C:\Users\Benny\Google Drive\PSAP\Assignments\Assignment_2_PSP\Assignment_2_Part2\game.py",
line 115, in undraw
self.image.undraw() File "C:\Users\Benny\Google Drive\PSAP\Assignments\Assignment_2_PSP\Assignment_2_Part2\graphics.py",
line 783, in undraw
del self.imageCache[self.imageId] # allow gc of tk photoimage KeyError: 6