import tkinter import tkinter.filedialog def btn_click(): global p c = tkinter.filedialog.askopenfilename(filetypes=[("PNG",".png")]) p = tkinter.PhotoImage(file=c) b2.config(image=p) main = tkinter.Tk() main.geometry('800x600') b1 = tkinter.Button(main, text='Open') b1.config(command=btn_click) b1.pack() b2 = tkinter.Button(main, text='...') b2.pack()