How to display two images on the same Tkinter Toplevel () window How to display two images on the same Tkinter Toplevel () window tkinter tkinter

How to display two images on the same Tkinter Toplevel () window


I'm using python 3.4 so i'm not 100% sure this will work for you (for me Tkinter is tkinter)

When I want to use multiple images I add them all to a list, you don't need to do anything with the list after that

This has always worked for me and I have the same problem you described without a list

from Tkinter import *import tkMessageBoxfrom PIL import ImageTk, Imageglobal all_imagesall_images = []def photo_browse ():    def selection_listbox (evt):            global chosen_photo        chosen_photo = str (photo_listbox.get (photo_listbox.curselection ()))        image_location = "Pics/" + chosen_photo        global pict        pict = Image.open (image_location)        global pic        pic = ImageTk.PhotoImage (pict)        # adding all the images to a list has worked for me in the past        global all_images        all_images = all_images + [chosen_photo, pic, pict]