Reputation: 8039
I am in heavy debugging mode where I have to restart the kernel fairly frequently, and am making heavy use of lots of cells in Spyder. When I am about 10 cells in and this happens, it would be really nice to be able to just run all cells above the current cell, sort of like you have in Jupyter.
I know I can manually go through and run cells 1-9 with Shift-Enter
, or I can select all the code manually and hit F9
. Is there a shortcut?
Upvotes: 1
Views: 1657
Reputation: 2071
I usually just create a syntax error where I want to stop execution and then press F5.
EDIT:
It just occurred to me that this isn't quite right. A syntax error will prevent execution from starting. What I actually do is provoke a NameError:
NameError: name 'stop' is not defined
Upvotes: 2
Reputation: 34156
(Spyder maintainer here) There's no shortcut and no way to run all cells above or below the current one.
However, I think this is a very valid concern, so please open an issue in our issue tracker so we don't forget to implement it in a future release.
Upvotes: 2