|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
from tkinter import *
root = Tk()
textLabel = Label(root,text = '您下载的影片含有未成年人限制内容,请满18周岁再点击观看!')
textLabel.pack(side = LEFT)
photo = PhotoImage(file = "18")
imgLabel = Label(root,image = photo)
imgLabel.pack(side = RIGHT)
root.mainloop()
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\3.py", line 8, in <module>
photo = PhotoImage(file = "18")
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\tkinter\__init__.py", line 3545, in __init__
Image.__init__(self, 'photo', name, cnf, master, **kw)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\tkinter\__init__.py", line 3501, in __init__
self.tk.call(('image', 'create', imgtype, name,) + options)
_tkinter.TclError: couldn't open "18": no such file or directory
>>>
我将python文件和图片均放在桌面 图片gif 格式的 命名为 18 但是怎么都导入不了????
|
|