title: PyQt QWidget window closes immediately upon showing?
body: <p>I realize that this question has been asking several times before, though none of them seem to apply to my situation. I have installed PyQt, and am simply trying to open up a window as such:</p>
  
  <pre><code>import sys
  from PyQt4 import QtGui as qt
  
  segmentation = qt.QApplication(sys.argv)
  main = qt.QWidget()
  main.show()
  </code></pre>
  
  <p>All the other questions I have looked at on here usually were caused by an error with the window going out of scope because of the window's <code>show</code> method being called from within a function, or something similar. </p>
  
  <p>My code uses no functions at all so this cannot be the issue. This should work as it is, no? I am following this tutorial:</p>
  
  <p><a href="https://www.youtube.com/watch?v=JBME1ZyHiP8" rel="noreferrer">https://www.youtube.com/watch?v=JBME1ZyHiP8</a></p>
  
  <p>and at time 8:58, the instructor has pretty much exactly what I have written, and their window shows up and stays around just fine. Mine displays for a fraction of a second and then closes. </p>
  
  <p>Screen shot of the code block from the video to compare to the code block provided here:</p>
  
  <p><a href="https://i.stack.imgur.com/iWCrs.png" rel="noreferrer"><img src="https://i.stack.imgur.com/iWCrs.png" alt="Demo code that works"></a></p>