创建配置文件时,选择Python File,然后修改下program和python的值:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: debug_main", #可任意
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/debug_main.py",
"console": "integratedTerminal",
"justMyCode": true,
"python": "/Users/ws/your_venv/bin/python3", #Python interpreter
}
]
}