问题
I am running a cell in Jupyter notebook where an error is bound to occur after some time(usually hours). But even after this error occurs, I want the compiler to just move on to the next cell and run the remaining cells that I put in the queue to be run after this cell finishes.
I know exceptions might be able to do this, but I wanted to know if there was any other way specific to Python or Jupyter notebook that might do the trick.
Cell 1: Some code running # Error will occur here and stop the execution
Cell 2,3...,n: Some code # Code should still run after the error occurs in Cell 1
Thanks for any solutions. The help is appreciated.
回答1:
There's a Jupyter Notebook nbextensions extension called Runtools which allows you to run all cells and ignore errors with the shortcut Alt + F. See Installing jupyter_contrib_nbextensions on how to install nbextensions and enable extensions like Runtools.
来源:https://stackoverflow.com/questions/56402480/how-to-automatically-execute-next-cell-even-if-an-error-occurs-in-the-current-ce