Aug-23-2019, 02:26 PM
Exec is part of Python 3 built-functions. The message box appears in blank "except" condition. This is bad practice as it will catch everything and may hide other errors. Try narrowing the problem down by removing some part of your code. For instance, does it still crash like this?
def connectDB(): msg = QtWidgets.QMessageBox(3, "Warning", "Please check the internet connection", QtWidgets.QMessageBox.Ok) msg.exec_()Prehaps the dialog is collected by the garbage collector? Try to bind "msg" to "self" so the object persist after the loop.