Lightweight cross-platform way to prompt for a file

前端 未结 2 1149
难免孤独
难免孤独 2021-01-15 05:16

I found a very built-in and easy way to prompt a system-specific nice open file dialog:

import Tkinter
from tkFileDialog import askopenfilename
tk_root = Tki         


        
2条回答
  •  伪装坚强ぢ
    2021-01-15 05:45

    There is a C library designed to perform this function, which could be wrapped in python.

    https://github.com/mlabbe/nativefiledialog

    Not sure what limitations the py2exe format imposes but I think this could be packaged into a pip wheel for example.

提交回复
热议问题