Previous cell execution
djangoliv opened this issue · comments
Is it possible to run the previous notebook cell with ipylab?
I have a notebook with a cell with a button widget that runs unittests on the code in the cell above.
So it would be great to programmatically run the latest version of the code I want to test (which is in the previous cell) before.
Regards
Looking at the list of available commands, maybe a combination of notebook:move-cursor-up
and notebook:run-cell
would work?
https://jupyterlab.readthedocs.io/en/latest/user/commands.html#commands-list
Looking at the list of available commands, maybe a combination of
notebook:move-cursor-up
andnotebook:run-cell
would work?https://jupyterlab.readthedocs.io/en/latest/user/commands.html#commands-list
that make sense
Thanks @jtpio
It's actually a good idea. However, I can't get it to work in a simple way.
When I execute the second cell, the first cell is indeed executed (twice even, I don't know why) but the result is still not usable.
would you try notebook:run-all-below
after cursor up?
Thanks @jtpio
It's actually a good idea. However, I can't get it to work in a simple way.
When I execute the second cell, the first cell is indeed executed (twice even, I don't know why) but the result is still not usable.
@erkin98 thank you for participating in the discussion
There are several problems with this idea:
- The code in the second cell should not be re-executed, otherwise the code will loop.
- But above all, I don't want to run my entire notebook which potentially contains other cells underneath.