title: Open a widget with button PyQt5
body: <p>I have a button connected to a function called OpenSupplyWidget() which is supposed to start a QWidget class I have in another file (the file is SupplyWidget.py and is already imported).</p>
  
  <pre><code>def OpenSupplyWidget(self):
      sw = SupplyWidget()
      sw.show()
  </code></pre>
  
  <p>The function only opens the window for a split second. Using sys.exit(app.exec_()) only returns an error saying the QApplication event loop is already running.</p>
  
  <p>What method do I use to get what I want (opening a widget)?</p>
  
  <p>Thanks!</p>