from tkinter import *
from tkinter.filedialog import *
wd = Tk()
def func_open():
fname = askopenfilename(parent=wd, filetypes=( ("gifs","*.gif"), ("alls","*.*") ))
photo1 = PhotoImage( file = fname )
pLabel.configure( image = photo1 )
pLabel.image=photo1
temp = PhotoImage()
pLabel = Label(wd, image = temp )
pLabel.pack(expand=1)
mainMenu = Menu(wd)
wd.config(menu=mainMenu)
fileMenu = Menu(mainMenu)
mainMenu.add_cascade(label="File", menu=fileMenu)
fileMenu.add_command(label="Open",command=func_open)
wd.mainloop()
2 lines of code above,
pLabel.configure( image = photo1 )
pLabel.image=photo1
if i remove one of these, func_open()
can't print image file.
To me, it seems like both line says same thing,
as pLabel.configure( image = photo1 )
put image through argument photo1
and pLabel.image=photo1
is directly put photo1 to pLabel's image.
I tried search that .configure() method but i couldn't get any understandable imformation.