<legend id='YlIlt'><style id='YlIlt'><dir id='YlIlt'><q id='YlIlt'></q></dir></style></legend>

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

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

        QtWidgets.QFileDialog.getOpenFileName 返回一个元组

        时间:2023-08-05
        <tfoot id='hTBvk'></tfoot>
          <tbody id='hTBvk'></tbody>

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

      3. <small id='hTBvk'></small><noframes id='hTBvk'>

        <legend id='hTBvk'><style id='hTBvk'><dir id='hTBvk'><q id='hTBvk'></q></dir></style></legend>

                  <bdo id='hTBvk'></bdo><ul id='hTBvk'></ul>
                  本文介绍了QtWidgets.QFileDialog.getOpenFileName 返回一个元组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我最近更新到了 Qt5 for Python 的新版本.在这样做的过程中,我不得不根据已经发生的一些显着变化来更改我的代码.我想深入了解我创建的这行代码.这感觉像是一种解决从函数中获取 string 而不是 tuple 问题的肮脏方式.(注意行尾的[0])

                  I've recently updated to the new version of Qt5 for Python. In doing so, I've been having to alter my code in accordance to some of the notable changes that have occurred. I wanted to get some insight into this line of code that I've created. It feels like a dirty way of solving the problem of getting a string instead of a tuple from the function. (Note the [0] at the end of the line)

                  filename = QtWidgets.QFileDialog.getOpenFileName(None, "Open " + key + " Data File", '.', "(*.csv)")[0]
                  

                  我想要 filename = {str}'C:/.././.../format.csv'

                  not filename = <class 'tuple'>: ('C:/.././.../format.csv', '(*.csv)')

                  推荐答案

                  在查看了一个也正在更新到 Qt5 的存储库之后;我发现他们使用了这样的一行.

                  After looking through a repository that was being updated to Qt5 as well; I found they used a line like this.

                  filename, _filter = QtWidgets.QFileDialog.getOpenFileName(None, "Open " + key + " Data File", '.', "(*.csv)")
                  

                  filename 是一个字符串,并且 (*.csv) 在 _filter 变量中被丢弃

                  filename is a string and the (*.csv) gets discarded in the _filter variable

                  这篇关于QtWidgets.QFileDialog.getOpenFileName 返回一个元组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:在同一 qtchart 上绘制烛台和 5 天平均线,但给出 下一篇:创建要嵌入到 QMainWindow 中的小部件

                  相关文章

                  最新文章

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

                      <tfoot id='pUwPk'></tfoot>

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