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()