QtWidgets.QFileDialog.getOpenFileName returns a Tuple

前端 未结 1 519
执念已碎
执念已碎 2020-12-19 05:22

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.

相关标签:
1条回答
  • 2020-12-19 05:46

    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 is a string and the (*.csv) gets discarded in the _filter variable

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