美文网首页
【Jupyter】UserWarning: To exit: u

【Jupyter】UserWarning: To exit: u

作者: HBU_DAVID | 来源:发表于2018-03-22 15:30 被阅读1143次

if name == 'main':
app = QApplication(sys.argv)
ex = Example()
sys.exit(app.exec_())
=====================
使用pyqt时候,pycharm中没事,Jupyter提示:
=====================
UserWarning: To exit: use 'exit', 'quit', or Ctrl-D.
warn("To exit: use 'exit', 'quit', or Ctrl-D.", stacklevel=1)
=====================
解决方案:
if __name__ == '__main__':
app = QApplication(sys.argv)
app.aboutToQuit.connect(app.deleteLater)
ex = Example()
app.exec_()
=====================
ref:
https://stackoverflow.com/questions/25007104/what-the-error-when-i-close-the-dialog
https://stackoverflow.com/questions/10888045/simple-ipython-example-raises-exception-on-sys-exit

相关文章

网友评论

      本文标题:【Jupyter】UserWarning: To exit: u

      本文链接:https://www.haomeiwen.com/subject/fipaqftx.html