<tfoot id='IakiP'></tfoot>

    1. <legend id='IakiP'><style id='IakiP'><dir id='IakiP'><q id='IakiP'></q></dir></style></legend>
        <bdo id='IakiP'></bdo><ul id='IakiP'></ul>

      <small id='IakiP'></small><noframes id='IakiP'>

      1. <i id='IakiP'><tr id='IakiP'><dt id='IakiP'><q id='IakiP'><span id='IakiP'><b id='IakiP'><form id='IakiP'><ins id='IakiP'></ins><ul id='IakiP'></ul><sub id='IakiP'></sub></form><legend id='IakiP'></legend><bdo id='IakiP'><pre id='IakiP'><center id='IakiP'></center></pre></bdo></b><th id='IakiP'></th></span></q></dt></tr></i><div id='IakiP'><tfoot id='IakiP'></tfoot><dl id='IakiP'><fieldset id='IakiP'></fieldset></dl></div>

        提示文件的轻量级跨平台方式

        时间:2023-07-06

        <small id='72PTF'></small><noframes id='72PTF'>

      2. <legend id='72PTF'><style id='72PTF'><dir id='72PTF'><q id='72PTF'></q></dir></style></legend>

          <bdo id='72PTF'></bdo><ul id='72PTF'></ul>

                  <tbody id='72PTF'></tbody>
              1. <i id='72PTF'><tr id='72PTF'><dt id='72PTF'><q id='72PTF'><span id='72PTF'><b id='72PTF'><form id='72PTF'><ins id='72PTF'></ins><ul id='72PTF'></ul><sub id='72PTF'></sub></form><legend id='72PTF'></legend><bdo id='72PTF'><pre id='72PTF'><center id='72PTF'></center></pre></bdo></b><th id='72PTF'></th></span></q></dt></tr></i><div id='72PTF'><tfoot id='72PTF'></tfoot><dl id='72PTF'><fieldset id='72PTF'></fieldset></dl></div>

                <tfoot id='72PTF'></tfoot>
                  本文介绍了提示文件的轻量级跨平台方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我发现了一种非常内置且简单的方法来提示系统特定的漂亮打开文件对话框:

                  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 = Tkinter.Tk()
                  tk_root.withdraw()
                  
                  result = askopenfilename(
                      filetypes=[("Foos", "*.png")],
                  )
                  

                  但是,就大小而言,这种依赖性太重了.我正在使用 py2exe 打包我的应用程序,并且由于必须包含 Tkinter,该应用程序要大 7 兆字节.肯定有更简单的方法来提示适用于 Windows、Mac 和 Linux 的本机文件对话框?

                  However, this is way too heavy a dependency in terms of size. I'm packaging my app with py2exe and the app is 7 megabytes bigger for having to include Tkinter. Surely there must be a simpler way to prompt a native file dialog that works on Windows, Mac, and Linux?

                  推荐答案

                  有一个C库设计来执行这个功能,可以用python包装.

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

                  https://github.com/mlabbe/nativefiledialog

                  不确定 py2exe 格式有什么限制,但我认为这可以打包到一个点子轮中.

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

                  这篇关于提示文件的轻量级跨平台方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Pip 安装失败:需要 SSL 下一篇:python setuptool 如何为 libxml2-dev 和 libxslt1-dev 添加依赖项?

                  相关文章

                1. <legend id='jD4nZ'><style id='jD4nZ'><dir id='jD4nZ'><q id='jD4nZ'></q></dir></style></legend>

                2. <small id='jD4nZ'></small><noframes id='jD4nZ'>

                    <tfoot id='jD4nZ'></tfoot>

                      <i id='jD4nZ'><tr id='jD4nZ'><dt id='jD4nZ'><q id='jD4nZ'><span id='jD4nZ'><b id='jD4nZ'><form id='jD4nZ'><ins id='jD4nZ'></ins><ul id='jD4nZ'></ul><sub id='jD4nZ'></sub></form><legend id='jD4nZ'></legend><bdo id='jD4nZ'><pre id='jD4nZ'><center id='jD4nZ'></center></pre></bdo></b><th id='jD4nZ'></th></span></q></dt></tr></i><div id='jD4nZ'><tfoot id='jD4nZ'></tfoot><dl id='jD4nZ'><fieldset id='jD4nZ'></fieldset></dl></div>
                        <bdo id='jD4nZ'></bdo><ul id='jD4nZ'></ul>