简体   繁体   中英

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

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. it is implemented from pyqt4 to pyqt5 which is latest one! 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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