import cv2 def choose_file(): # 选择 文件 selectFileName = tk.filedialog.askopenfilename(title='\u9009\u62e9\u6587\u4ef6') e.set(selectFileName) def show(e_entry): #显示图片 img = cv2.imread(e_entry.get()) cv2.imshow("PICTURE",img) cv2.waitKey(0) def window(): GUI程序与用户交互,一个重要的方面就是让用户 选择 文件 文件夹 ,比如 选择 要执行某个动作的 文件 文件夹 ,或者要 选择 一个 文件 来保存某些内容的时候。 Python 标准的 tkinter .filedialog模块,提供了这类对话框实现的简单接口。askopenfilename这个对话框,可以让用户 选择 一个 文件 。>>> import tkinter as tk>>> root = tk.Tk()>>> from...