Skip to content
Advertisement

Restarting kernel, ipython console in spyder

I am having this problem in spyder where, after I run my code and exit the gui.program, the kernel needs to manually be restarted after every time my code is ran, I sometimes even have to shut down spyder as kernel crashes. I am wondering if there is a way for the kernel to automatically be reset after closing the gui.program so I can run it again right after? This closes the program but doesn’t restart the kernel.

JavaScript

Advertisement

Answer

I found the issue, I had sys.exit() in my EndProgram() function as well as at the end of my code as seen here: sys.exit(app.exec_()). Once I took out the sys.exit() in my EndProgram function and changed sys.exit(app.exec_()) to sys.exit(), it is working perfect.

Original Code

JavaScript

New code

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement