path = str(QtGui.QFileDialog.getExistingDirectory(self, "Select Directory  "))

How to read the file form directorydialog

有帮助吗?

解决方案

file = str(QtGui.QFileDialog.getOpenFileName(self, "Select File", "", "*.png *.jpg"))
print file

This will list only png and jpg files, type the file extension you want to list.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top