小编use*_*771的帖子

在Python中浏览文件或目录对话框

我正在用Python做一个小项目,我想浏览一个文件或目录来获取它们的路径.

我正在使用Tkinter,我只能找到一个文件浏览器:

filename = tkFileDialog.askopenfilename(parent=root,title='Open file to encrypt')
Run Code Online (Sandbox Code Playgroud)

或只是一个目录浏览器:

dir =  tkFileDialog.askdirectory(parent=root, title='Open file to encrypt')
Run Code Online (Sandbox Code Playgroud)

是否有可能将这两者结合起来?谢谢你的所有答案!

python browser directory file tkinter

6
推荐指数
1
解决办法
9565
查看次数

标签 统计

browser ×1

directory ×1

file ×1

python ×1

tkinter ×1