Using the Python Extension for Visual Studio Code you can define code cells in your Python code using #%%:
#%% a = 1 breakpoint() b = 2 Then you can click "Run Cell" and VS Code will open a Python Interactive window and run the current cell. Unfortunately if you run the cell above it will fail because of the breakpoint() line. The error is:
StdinNotImplementedError: raw_input was called, but this frontend does not support input requests. If you comment out the breakpoint it runs but doesn't stop at the breakpoint:
#%% a = 1 #breakpoint() b = 2 If you remove the special "Run Cell" comment it will stop at the breakpoint but then you lose Python Interactive:
a = 1 breakpoint() b = 2 You can (kindof) get the best of both worlds by replacing the breakpoint by clicking in the gutter in Visual Studio Code to add a breakpoint:
However I would prefer to write my breakpoints in code. Any ideas on supporting this case?
