Is it possible to execute statements while the debug mode is active, possibly in the interactive mode?
Let's say I'm working with a dataframe. I go line by line in debug mode, and I want to check some properties while doing that, for example the number of NaN values.
Using the variable window to check the entries is a waste of time.
I could use write a print statement into my code, stop the debugging, start the debugging again, and then the print statement will be executed.
But that would mean always stopping and starting debug, as soon as I run into an unforeseen problem and trying to find out what's happening. Is it possible to execute statements while still remaining in debug, at the line you currently are at.
It would be especially good if there is a solution with running the statement in Interactive Mode because then I wouldn't need to mess with the original program.
When on a breakpoint you can use the Debug Console to run Python code in the current context.
It's in the same tab as "Problems", "Output" and "Terminal", typically under the Editor pane. See in the upper menu "View > Debug Console".
Visual Studio Code documentation:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With