报错:
from tkinter import *
img = PhotoImage(file = r'D:\test\hero\暗黑元首\暗黑元首.jpg')
lable_show = Label(frame_show,imag = img)
解决:首先安装PIL库,使用pip命令
pip install pillow
然后使用PIL库获得ImageTk.PhotoImage对象代替tk.PhotoImage对象即可
from PIL import Image,ImageTk
img = ImageTk.PhotoImage(Image.open(r'D:\test\hero\暗黑元首\暗黑元首.jpg'))
lable_show = Label(frame_show,imag = img)