from PyQt5 import QtWidgets import sys app = QtWidgets.QApplication(sys.argv) QtWidgets.QFileDialog.getOpenFileName() sys.exit(app.exec())