In Visual Studio Code, when debugging a python code (.py), is it possible to start an interactive session window interact with the program in that window?
It is suggested to "Add #%% at the top to indicate a Jupyter cell." This does start an interactive window, but the interactive session does not connect to the current .py file. It shows a pending sign when evaluating a variable in the interactive window.
I can evaluate a variable during a python debug session in the standard DEBUG CONSOLE window. But it will be nice to do everything in an interactive window without opening the debug console window.
Thank you!
current VS Code version: 1.98.0
-
Did you use debug cell?BRZ owner– BRZ owner2025年03月13日 03:17:58 +00:00Commented Mar 13, 2025 at 3:17
-
@MinxinYu-MSFT Debug cell and F5 will run the code to the breakpoint, but I still cannot evaluate variables in the interactive window.metrics– metrics2025年03月16日 01:02:28 +00:00Commented Mar 16, 2025 at 1:02
-
1Python interactive window does not support run multiple codes at the same time.BRZ owner– BRZ owner2025年03月17日 06:15:12 +00:00Commented Mar 17, 2025 at 6:15