Debug Python with VsCode


Visual Studio Code debugs Python. Here are the steps on Windows 10.
Create a folder with a .py file in it, e.g. Rio\proj\python\caller.py
Run code.exe, open the folder Rio\proj\python
Install extension: ms-python.python, which is the Python extension for VsCode from Microsoft.
Install pathon:
https://www.python.org/downloads python-3.7.3.exe 32bit 24M
which installs to C:\Users\rio\AppData\Local\Programs\Python\Python37-32\python.exe
Add config: click Debug then Add config, which creates S:\Rio\proj\python\.vscode\launch.json
Choose interpreter:
From Command Palette, type: Python: Select Interpreter
The installed python should be listed there, and click it.
Debug: open caller.py, set break point, hit the debug icon, they hit the green arrow in the tool bar.
execution should stop and variables can be inspected by mouse over.VsCodePy

Advertisements
Next Post
Comments are closed.
%d bloggers like this: