|
|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
小白想用给定文件内容构造图像,于是用了Image,可是程序一直报错,如下:
Traceback (most recent call last):
File "<pyshell#40>", line 1, in <module>
flowerImage = Image(Point(100,100),"flower.gif")
File "D:\python-3.7.2\lib\site-packages\graphics.py", line 885, in __init__
self.img = tk.PhotoImage(file=pixmap[0], master=_root)
File "D:\python-3.7.2\lib\tkinter\__init__.py", line 3545, in __init__
Image.__init__(self, 'photo', name, cnf, master, **kw)
File "D:\python-3.7.2\lib\tkinter\__init__.py", line 3501, in __init__
self.tk.call(('image', 'create', imgtype, name,) + options)
_tkinter.TclError: couldn't recognize data in image file "flower.gif"
我明明已经把图片放在Python的文件夹中了,可是为什么显示错误,求解!!! |
|