title: why will the application show after sys.exit command?
body: <p>I'm following this tutorial:</p>
  
  <p><a href="http://zetcode.com/tutorials/pyqt4/firstprograms/" rel="nofollow">http://zetcode.com/tutorials/pyqt4/firstprograms/</a></p>
  
  <p>and on the very first example I don't understand why does the application show only after the command:</p>
  
  <pre><code>sys.exit(app.exec_())
  </code></pre>
  
  <p>Also, I modified the code slightly to test things</p>
  
  <pre><code>import sys
  from PyQt4 import QtGui
  
  
  if __name__ == "__main__":
      app = QtGui.QApplication(sys.argv)
      w = QtGui.QWidget()
      w.resize(250,150)
      w.move(300,300)
      w.setWindowTitle("Title")
      w.show()
      sys.exit(app.exec_())
  </code></pre>
  
  <p>If I run this in the terminal and comment out the last line it will only show the window after running the last line.</p>
  
  <p>I don't quite understand what the last line does.</p>
  
  <p>EDIT:</p>
  
  <p>I'm also confused as to why there isn't a reference of <code>app</code> and <code>w</code> i'd expect some kind of indication that <code>w</code> is a child or something of <code>app</code>.</p>
  
  <p>I'm running it in Spyder and an IPython interpreter.</p>