Im trying to put a image in a tkinter window with this code...
from tkinter import *
from PIL import ImageTk, Image
root = Tk
my_img = ImageTk.PhotoImage(Image.open("Imagem1.png"))
MyLabel = Label(root, image=my_img)
MyLabel.pack()
root.mainloop()
But it keeps getting this error "name 'PhotoImage' is not defined"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.