1

I want to know if there is an option in the Notebook UI or some magic command (for a cell) that prevents its re-execution. For e.g., if I execute a few cells in sequence, and wanted to go back to re-run the first cell, then I should be prevented from doing that.

goelakash
  • 2,502
  • 4
  • 40
  • 56

1 Answers1

1

For the old Jupyter notebook see: How to freeze a cell alone with its outputs on a jupyter notebook.

For JupyterLab there is no extension yet but there is an agreement that this is a good idea. Everyone can become an extension author and contribute it. A good starting point is the Extension Developer guide.

If the cell has no output that you care about you can use a handy trick of temporarily switching its type to "raw" (as raw cells don't get executed). It can be done with a keyboard sequence of Esc, r; then to restore its type to "code" cell you can use Esc, y.

krassowski
  • 13,598
  • 4
  • 60
  • 92