|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 tiger20100907 于 2022-7-27 09:00 编辑
- from tkinter import *
- root = Tk( )
- textLabel = Label(root,text="您所下载的影片含有未成年人限制内容,请满18周岁后再点击!")
- textLabel.pack()
- photo = PhotoImage(file="18.gif")
- ingLabel = Label(root, image=photo)
- ingLabel.pack()
- mainloop()
复制代码
报错
- Traceback (most recent call last):
- File "C:\Users\Hp\Desktop\tk2.py", line 8, in <module>
- photo = PhotoImage(file="18.gif")
- File "C:\Python34\lib\tkinter\__init__.py", line 3421, in __init__
- Image.__init__(self, 'photo', name, cnf, master, **kw)
- File "C:\Python34\lib\tkinter\__init__.py", line 3377, in __init__
- self.tk.call(('image', 'create', imgtype, name,) + options)
- _tkinter.TclError: couldn't recognize data in image file "18.gif"
复制代码
这段代码错在哪里了
|
|