0
我想選擇從FileDialog的文件,並在GUI中顯示的畫面Python 3 - Tcl/Tk如何從filedialog中獲取圖像並顯示它?
def onOpen():
""" Ask the user to choose a file and change the update the value of photo"""
photo= get(filedialog.askopenfilename())
photo2 = PhotoImage(filedialog=photo)
#how do I get photo2 to work and get button to display the picture?
button = Button(root, image=photo2, text="click here", command=onOpen).grid()
root.mainloop()