debug spyder using breakpoints in editor and code calling from console

Viewed 17

My impression is that in Spyder breakpoints are triggered when calling execution with debugging. My normal workflow is to write some code and then type a line or two to test that code in the console. Doing so fails to trigger the breakpoint. Instead to debug I am constantly typing import pdb; pdb.set_trace() in the editor where I want the breakpoint to be triggered. Is there a way of getting the console to respect breakpoints (ideally by default) so that I can just type a line or two to run my code and then get the editor breakpoints to be respected? I guess the alternative is to create a temporary file for placing my temporary code, although that is not ideal. Often I have the code in the library I am writing as an example in the comments, and I'm simply selecting that code snippet and asking the selection to be executed.

I'm using Spyder 4.2 on Windows for reference.

0 Answers
Related