python 我需要在tkinter画布中的图像这里的代码,但错误来了

qvtsj1bj  于 2023-04-28  发布在  Python
关注(0)|答案(1)|浏览(78)
c = tkinter.Canvas(width=275,height=300)
so_ramdom = tkinter.PhotoImage("/Users/vikranthracherla/Downloads/download.jpeg")
c.create_image(image=so_ramdom)

错误

Traceback (most recent call last):
  File "d27.py", line 33, in <module>
    c.create_image(image=so_ramdom)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py", line 2325, in create_image
    return self._create('image', args, kw)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py", line 2309, in _create
    cnf = args[-1]
IndexError: tuple index out of range
7kqas0il

7kqas0il1#

c.create_image(x,y,.....还注意到您没有将任何坐标传递到

相关问题