I donβt think you mean the core crash. Rather, I think you're talking about exiting the python console. This is called sys.exit(app.exec_()) . For example, try (for example, in spyder) the following two codes:
import sys from PyQt4 import QtGui app = QtGui.QApplication(sys.argv) widget = QtGui.QWidget() widget.setWindowTitle('simple') widget.show()
Here you should get a blank window and the python console will stay alive. The second, where sys.exit(app.exec_()) enabled, will exit the python console at the end and the window will disappear:
import sys from PyQt4 import QtGui app = QtGui.QApplication(sys.argv) widget = QtGui.QWidget() widget.setWindowTitle('simple') widget.show() sys.exit(app.exec_())
Hope this helps.
user3413108
source share