Obraz Tkinter nie pokazuje ani nie daje błędu
Próbowałem dwóch różnych rzeczy, aby spróbować wyświetlić obraz na etykiecie
#This gives " TclError: couldn't recognize data in image file "TestImage.gif" "
imgPath = "TestImage.gif"
photo = PhotoImage(file = imgPath)
label = Label(image = photo)
label.image = photo # keep a reference!
label.grid(row = 3, column = 1, padx = 5, pady = 5)
i
#This gives no error but the image doesn't show
imgPath = "TestImage.gif"
photo = PhotoImage(imgPath)
label = Label(image = photo)
label.image = photo # keep a reference!
label.grid(row = 3, column = 1, padx = 5, pady = 5)
Obraz znajduje się w tym samym folderze, co cały kod. Wszelkie sugestie dotyczące pokazywania obrazu?