How should I stop a busy cell in an iPython notebook?

PythonJupyter Notebook

Python Problem Overview


I have trouble stopping a given kernel in an iPython notebook.

Many times the cell is stuck, and I need to restart the entire kernel. The loop could be messy sometimes.

How can I stop the kernel?

Python Solutions


Solution 1 - Python

Click on 'Interrupt' under 'Kernel' in the toolbar. Pressing I twice will also do the trick.

Source - https://stackoverflow.com/questions/17561212/is-there-an-equivalent-to-ctrlc-in-ipython-notebook-in-firefox-to-break-cells-t/38229513#38229513

Solution 2 - Python

  1. You can follow 'Kernel' --> 'Interrupt' in the menu bar at the top.
  2. Pressing 'I' to the left of the cell also works. This only works if you're in command mode. If not already enabled, press Esc to enable it.
  3. If you are okay to lose variables,you might restart the session.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionaviyaronView Question on Stackoverflow
Solution 1 - PythonAshish TyagiView Answer on Stackoverflow
Solution 2 - Pythonsai_varshitthaView Answer on Stackoverflow