I always used pdb for Python debugging before. Recently, I start using Visual Studio Code.
It looks in Visual Studio Code debugger, if I set a breakpoint(), Visual Studio Code will show variables' value at stopped position in the left window and I have to control it by a GUI bar.
So in "integratedTerminal" or "externalTerminal", I have no control by command line which is shown here and there isn't a pdb prompt popup. I kind of feel this surprises me since it hijacks pure Python stuff.
So is there a way to have both, the variables watch window and pdb prompt control? Especially in "integratedTerminal" or "externalTerminal".
Below are files under folder .vscode,
{
"python.pythonPath": "/Users/<USERNAME>/miniconda3/envs/<CONDA_ENV>/bin/python"
}
{
"version": "0.2.0",
"configurations": [
{
"name": "Python Module",
"type": "python",
"python": "/Users/<USERNAME>/miniconda3/envs/<CONDA_ENV>/bin/python",
"request": "launch",
"program": "/Users/<USERNAME>/miniconda3/envs/<CONDA_ENV>/bin/<COMMAND>",
"console": "integratedTerminal",
"args": [
"hello-world"
],
"cwd": "${workspaceRoot}",
}
]
}
According to the information you described, when I use "breakpoint()" in the code, I click F5 to debug the code in Visual Studio Code. When the code stops, we can use the shortcut key Ctrl + Shift + ` to open a new terminal and enter the pdb interactive window. At this point, we can not only see the debug variable value, but also use the 'pdb' command:

Update:

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