0
from tkinter import *
from PIL import ImageTk, Image
top = Tk()
file ='flame2.jpg'
filename = PhotoImage(file)
panel=PanedWindow()
panel = Label(top, image = filename)
panel.pack(side = "bottom", fill = "both", expand= "yes")
top.mainloop()
my_image = Image.open( 「flame2.jpg」) AttributeError的:對象類型'圖像'沒有屬性'打開' 編譯你發送的代碼後,這是錯誤發生。 –
嘗試'導入PIL.Image'而不是'從PIL導入圖像' –
錯誤保持不變。 –