How to put image in another window in tkinter? How to put image in another window in tkinter? tkinter tkinter

How to put image in another window in tkinter?


Apologies for my previously incorrect answer.The reason the image is not showing is due to the fact that you did not create a reference to it. If you don't create a reference, the image is garbage collected, which doesn't remove it, but in a sense just renders a blank placeholder on the GUI.

In order to display the image correctly you need to add a reference to the image within the code that displays the image.You therefore now have:

fondov=tk.PhotoImage(file="giphy.gif") label1=tk.Label(ventana2,image=fondov) label1.image = fondov label1.pack()

(label1.image = fondov is the reference)

Sorry for the confusion there. This should work.