options = QFileDialog.Options()
options |= QFileDialog.DontUseNativeDialog
fileName, _ = QFileDialog.getOpenFileName(self,"QFileDialog.getOpenFileName()", "","All Files (*);;Python Files (*.py)", options=options)
db = ''
if fileName:
try:
quit ,data = parser(fileName,db )
print('Data Parsed')
except Exception as e:
with open(self.logfile, 'w+') as fn:
fn.write(str(e) + '\n')
error = QPushButton()
error.setText(f'{e}')
error.move(50,50)
error.clicked.connect(sys.exit(app.exec_()))
return data
why is the dialog box not working on error?
بفرما!
Обсуждают сегодня