python报错_couldntrecognizedatainimagefile ⼀、描述
报错:couldn't recognize data in image file
代码:螨虫的症状
from tkinter import *
root = Tk()
养驴技术theLabel = Label(root,text="dog",justify=LEFT,padx=10)
山大视点
theLabel.pack(side=LEFT)
photo = PhotoImage(file="D:/PythonProject/dog.jpg")
imgLabel = Label(root,image=photo)
imgLabel.pack(side=RIGHT)在一起多好
root.mainloop()
2022高考文综
2.原因男女之间
感动中国2016
PhotoImage报错,因为file参数只接受gif⽂件,不能接受jpeg、jpg⽂件。
gif⽂件不单指以.gif结尾的⽂件,⽽是说图⽚格式,所以只修改后缀名没有丝毫作⽤。
3.解决
1.上⽹download⼀个gif⽂件。
2.打开,另存成其他格式的⽂件。
3.使⽤其他模块。北极星电影