鱼C论坛

 找回密码
 立即注册
查看: 1878|回复: 1

[已解决]求助!

[复制链接]
发表于 2022-7-25 15:11:06 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
本帖最后由 tiger20100907 于 2022-7-27 09:00 编辑
  1. from tkinter import *

  2. root = Tk( )

  3. textLabel = Label(root,text="您所下载的影片含有未成年人限制内容,请满18周岁后再点击!")
  4. textLabel.pack()

  5. photo = PhotoImage(file="18.gif")
  6. ingLabel = Label(root, image=photo)
  7. ingLabel.pack()

  8. mainloop()
复制代码


报错
  1. Traceback (most recent call last):
  2.   File "C:\Users\Hp\Desktop\tk2.py", line 8, in <module>
  3.     photo = PhotoImage(file="18.gif")
  4.   File "C:\Python34\lib\tkinter\__init__.py", line 3421, in __init__
  5.     Image.__init__(self, 'photo', name, cnf, master, **kw)
  6.   File "C:\Python34\lib\tkinter\__init__.py", line 3377, in __init__
  7.     self.tk.call(('image', 'create', imgtype, name,) + options)
  8. _tkinter.TclError: couldn't recognize data in image file "18.gif"
复制代码


这段代码错在哪里了
最佳答案
2022-7-25 15:54:40
gif不能被识别
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2022-7-25 15:54:40 From FishC Mobile | 显示全部楼层    本楼为最佳答案   
gif不能被识别
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-5-12 16:30

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表