1
我試圖繪製圖像到畫布上(中從一個地方到畫布上的轉換),但此錯誤出現包含_tkinter.TclError:未知的選項「pyimage2」
hastebin代碼: http://hastebin.com/tuciyisisa.py
Traceback (most recent call last):
File "D:\Stuff\python\Coursework\AQADo\main.py", line 82, in <module>
app = Application(master=root)
File "D:\Stuff\python\Coursework\AQADo\main.py", line 74, in __init__
self.drawCounter(space_y, current_space, game_canvas)
File "D:\Stuff\python\Coursework\AQADo\main.py", line 26, in drawCounter
canvas.create_image(170, space_y[current_space["1a"]], counter1)
File "C:\Python34\lib\tkinter\__init__.py", line 2291, in create_image
return self._create('image', args, kw)
File "C:\Python34\lib\tkinter\__init__.py", line 2282, in _create
*(args + self._options(cnf, kw))))
_tkinter.TclError: unknown option "pyimage2"
與線路'canvas.create_image((90,space_y [current_space [ 「1A」]]),圖像=計數器1) '代替它,它不汲取還沒有錯誤的 似乎成爲背景圖片的問題然而, –
奇怪,適用於我的機器。你使用的是什麼版本的Python?您使用什麼操作系統?你在使用IDE嗎?你是否從命令行運行腳本?你是否將它粘貼到[repl]中(http://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop)? – Kevin
看到我的編輯,這是我的錯。謝謝。看起來像它沒有繪製到屏幕上我使用'canvas.create_image((90,space_y [current_space [「1a」]]),image = counter1,anchor = NW)'' –