Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 Python 中使用 QtDesigner 编写一个简单的程序,可以将变量保存到文件并再次从中加载。制作菜单供用户选择要加载的文件的最简单方法是什么?我想要打开文件列表并且用户必须能够点击他想要打开的文件?是否有特定的小部件?谢谢您的帮助。
QtGui.QFileDialog.getOpenFileName(None,"Load File","","Text (*.txt);;All Files (*)")
请注意,因为根据您使用的是 PyQT 还是 PySide,此调用返回的值会略有不同。