首页 Python系列3:在vscode中调试python
文章
取消

Python系列3:在vscode中调试python

创建配置文件时,选择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
        }
    ]
}

参考

https://code.visualstudio.com/docs/python/debugging

本文由作者按照 CC BY 4.0 进行授权