simple IPython example raises exception on sys.exit()

前端 未结 5 863
一个人的身影
一个人的身影 2020-12-01 14:55

I\'m doing some very simple PySide (and PyQt) tutorials in IPython. One tutorial just creates a window with some sliders to demonstrate slots and signals.

When I clo

5条回答
  •  感情败类
    2020-12-01 15:25

    Check if already an instance of QApplication is present or not as the error occurs when an instance is already running and you are trying to create a new one.

    if not QtWidgets.QApplication.instance():
        app = QtWidgets.QApplication(sys.argv)
    else:
        app = QtWidgets.QApplication.instance()
    

提交回复
热议问题