|
|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
- from tkinter import *
- root = Tk()
- textLabel = Label(root,
- text="对不起,程序出错了!",
- justify=LEFT,
- padx=10)
- textLabel.pack(side=LEFT)
- photo = PhotoImage(flie="wrong.jpg")
- imgLable = Lable(root,image=photo)
- imgLable.pack(side=RIGHT)
- mainloop()
复制代码
为什么运行会报错,显示了文字显示不了图片
- ======= RESTART: C:\Users\Administrator.SDWM-20130216OI\Desktop\tk3.py =======
- Traceback (most recent call last):
- File "C:\Users\Administrator.SDWM-20130216OI\Desktop\tk3.py", line 11, in <module>
- photo = PhotoImage(flie="wrong.jpg")
- File "C:\Program Files\Python36-32\lib\tkinter\__init__.py", line 3539, in __init__
- Image.__init__(self, 'photo', name, cnf, master, **kw)
- File "C:\Program Files\Python36-32\lib\tkinter\__init__.py", line 3495, in __init__
- self.tk.call(('image', 'create', imgtype, name,) + options)
- _tkinter.TclError: unknown option "-flie"
- >>>
复制代码
急用,谢谢大家求助!
|
|