conda update spyder
(or pip
, if not using Anaconda)jupyter qtconsole
(if console-related)spyder --reset
If I have cells in my code that take a long time to run, I want to avoid having to re run everything. Yet, if I want to debug just a part of my code, this is what I need to do.
It would be great to use a mechanism similar to runcell
(called debugcell
) to debug a single cell.
The logic is implemented in https://github.com/spyder-ide/spyder-kernels/pull/112, but I wonder if there should be a keyboard shortcut or something to trigger that from spyder.
If https://github.com/spyder-ide/spyder-kernels/pull/112 is merged, should there be a mechanism to trigger the cell debugging? For now I type debugcell('mycell')
in the console.
The simplest way to start debugging a cell is to put
import pdb; pdb.set_trace()
anywhere on it. I don't think we need more than that, do we?
Well you could make the same argument about debugfile. I can enter debugging without having to change my code and then remember to remove the line.
Right, but Python 3.7 makes things even easier with the breakpoint
builtin. I mean, we can add the debugcell
command to our kernel, but I'm -1 on adding a UI for it because it'd make our interface more complex.
How about just a line in the menu and a keyboard shortcut?
Ok, that's a good compromise.
Most helpful comment
How about just a line in the menu and a keyboard shortcut?