1

Is it possible to execute the previous cell from in jupyterlab ?

something like:

import IPython

IPython.exec_cell(-1)

I want to execute the previous cell (if it has been updated without having been re-executed). I have a cell that contains the test from the previous. If I modify the function, I want to only execute the cell that contains the test.

djangoliv
  • 1,698
  • 14
  • 26
  • Possible duplicate of [Programmatically get current Ipython notebook cell output?](https://stackoverflow.com/questions/27952428/programmatically-get-current-ipython-notebook-cell-output) – Peter Wood Aug 20 '18 at 13:42
  • You can run the previous (as in previous cell to run) through `%rerun` magic command. Documentation: https://ipython.readthedocs.io/en/stable/interactive/magics.html#magic-rerun – Swier Aug 20 '18 at 13:45
  • @PeterWood no I want to reexecute the cell not get the output. If I change a function in the previous cell, I want to have the new function – djangoliv Aug 20 '18 at 14:10
  • @Swier the %rerun command execute the previous input (history) not the previous cell of a notebook. – djangoliv Aug 20 '18 at 14:11

0 Answers0