Bharathi
Bharathi

Reputation: 477

how to open files names from directory dialog in pyqt

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

How to read the file form directorydialog

Upvotes: 1

Views: 3067

Answers (1)

qurban
qurban

Reputation: 3945

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.

Upvotes: 3

Related Questions