|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
from tkinter import *
root = Tk()
textLabel = Label(root,text='您就是那位光之巨人,\n迪迦!!!!!',
justify=LEFT,
padx=10)
textLabel.pack(side=LEFT)
photo = PhotoImage(file='QQ图片.png')
imgLabel = Label(root,image=photo)
imgLabel.pack(side=RIGHT)
mainloop()
报错:Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\PYTHON Tkinter.py\pictur.py", line 8, in <module>
photo = PhotoImage(file='QQ图片.png')
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 "QQ图片.png": no such file or directory
支持png格式的图片吧好像 
|
|