open file pyqt code example
Example 1: open file dialog on button click pyqt5
def open(self):
path = QFileDialog.getOpenFileName(self, 'Open a file', '',
'All Files (*.*)')
if path != ('', ''):
print(path[0])
Example 2: pyqt open file dialog
def open_file(self):
def open(self):
path = QFileDialog.getOpenFileName(self, 'Open a file', '',
'All Files (*.*)')
if path != ('', ''):
print(path[0])