我想使用tkinter.filedialog来获取文件路径和文件名,但是在选择完后会留下一个名为tk()的窗体 ,强制关闭会卡死,请问如何关闭呢
我使用的代码如下
from tkinter.filedialog import askopenfilename
fname = askopenfilename(filetypes=( ("Text file", "*.txt*"),("HTML files", "*.html;*.htm")))
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
我用的python2, 使用的是
tkFileDialog可以正常。