Normally in Qt applications you would use this at the start and end of your code:
app = QtWidgets.QApplication(sys.argv) ... app.exec_()
But in M