I am working with PySide and PyQt for GUI development. I have been using these codes to run a GUI application:
app = QApplication(sys.argv)
ex = MyWin()
ex.show()
sys.exit(app.exec_())
Accidentally I found if I replace sys.exit(app.exec_())
with only app.exec_()
, the program still works fine and it can exit correctly.
So what is the difference between these two? Is there a reason I should use sys.exit(app.exec_())
?