sys.exit(app.exec_()) PyQT Python - why the app.exec_() is passed as an argument?
<p>New to PyQt. Can someone please explain to me why we do this:</p>

<pre><code> sys.exit(app.exec_())
</code></pre>

<p>instead of:</p>

<pre><code>app.exec_()
sys.exit()
</code></pre>

<p>I've tried and both work. And Question 2: I thought that sys.exit(n) uses an argument n as an exit status. How come in the case of  sys.exit(app.exec_()), the app.exec_() is executed? Do arguments in sys.exit() get executed prior to the system terminating the app? I guess maybe I'm confused as to the "order of events" in this case. Can someone clarify this for me? Thanks. </p>