Lightweight cross-platform way to prompt for a file

前端 未结 2 1150
难免孤独
难免孤独 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.

    0 讨论(0)
  • 2021-01-15 05:58

    If you're developing a pygame app, there's a project called Pygame Utilities which has cross-platform support for file dialogs, among many other things. It appears to be fairly lightweight.

    Doesn't look to be very well documented, though. If you download the package, run the setup.py file in the docs directory to generate the documentation.

    0 讨论(0)
提交回复
热议问题