Search code examples
pyqtpyqt4showatom-editorqwidget

.show() not working in PtQt4


When I run the code below, I should be able to see a new window that I created. However, when I run it, I can see the new window appearing for a split second and disappearing. What could be the problem?

import sys
from PyQt4 import QtGui
applicationDefinition = QtGui.QApplication(sys.argv)
windowFigure = QtGui.QWidget()
windowFigure.show()

Solution

  • import sys
    from PyQt4 import QtGui
    
    applicationDefinition = QtGui.QApplication(sys.argv)
    windowFigure = QtGui.QWidget()
    windowFigure.show()
    applicationDefinition.exec_()