简体   繁体   English

PyQT5 - 警告使用“退出”、“退出”或 Ctrl-D 退出 jupyter 笔记本中的应用程序

[英]PyQT5 - Warning to use 'exit', 'quit', or Ctrl-D for quitting the application in jupyter notebook

I am currently learning PyQt5 and I have encountered this problem and solved it using the solution explained there, but since then, I am seeing this warning我目前正在学习 PyQt5,我遇到了这个问题并使用那里解释的解决方案解决了它,但从那时起,我看到了这个警告

An exception has occurred, use %tb to see the full traceback.

SystemExit: 0


/home/aditya/anaconda3/lib/python3.6/site-packages/IPython/core/interactiveshell.py:2971: UserWarning: To exit: use 
'exit', 'quit', or Ctrl-D.
warn("To exit: use 'exit', 'quit', or Ctrl-D.", stacklevel=1)

Now, I don't know if this warning could be harmful or not.现在,我不知道这个警告是否有害。 But how do I fix this?但是我该如何解决这个问题?

Any help is appreciated.任何帮助表示赞赏。 Thanks谢谢

you are facing this error because you are using in your code sys.exit() function.您遇到此错误是因为您在代码中使用了 sys.exit() 函数。 it is implemented from pyqt4 to pyqt5 which is latest one!它是从pyqt4到pyqt5实现的,这是最新的! i suggest you to do not use sys.exit instead of this you can use app = QApplication(sys.argv) app.exec_() app.quit() for terminating your window.我建议你不要使用 sys.exit 而不是这个你可以使用 app = QApplication(sys.argv) app.exec_() app.quit() 来终止你的窗口。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM