python使用vscode打断点调试

安装命令‌:通过 pip 直接安装(需 Python 3.6+):

pip install debugpy

launch.json

javascript 复制代码
{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Python: Flask (Direct)",
      "type": "debugpy",
      "request": "launch",
      "program": "${workspaceFolder}/app.py",
      "console": "integratedTerminal",
      "justMyCode": true,
      "env": {
        "FLASK_ENV": "development"
      }
    },
    {
      "name": "Python: Flask (Module)",
      "type": "debugpy",
      "request": "launch",
      "module": "flask",
      "env": {
        "FLASK_APP": "app.py",
        "FLASK_ENV": "development",
        "FLASK_DEBUG": "0"
      },
      "args": ["run", "--no-debugger", "--no-reload", "--host", "0.0.0.0", "--port", "5000"],
      "jinja": true,
      "justMyCode": true,
      "console": "integratedTerminal"
    },
    {
      "name": "Python: Current File",
      "type": "debugpy",
      "request": "launch",
      "program": "${file}",
      "console": "integratedTerminal",
      "justMyCode": true
    }
  ]
}
相关推荐
易辰君7 分钟前
【Python爬虫实战】正则:中文匹配与贪婪非贪婪模式详解
开发语言·爬虫·python
普通网友8 分钟前
PHP语言的正则表达式
开发语言·后端·golang
黎雁·泠崖9 分钟前
Java常用类核心详解(七):正则表达式 Regex 从入门到实战
java·开发语言·正则表达式
秀儿还能再秀10 分钟前
正则表达式核心语法 + Python的 re 库中常用方法
python·正则表达式
xcLeigh11 分钟前
Python入门:Python3 正则表达式全面学习教程
python·学习·正则表达式·教程·python3
PingdiGuo_guo15 分钟前
C++数据类型、变量常量
开发语言·c++
多恩Stone1 小时前
【C++ debug】在 VS Code 中无 Attach 调试 Python 调用的 C++ 扩展
开发语言·c++·python
PingdiGuo_guo1 小时前
C++联合体详解!
开发语言·c++
XW01059991 小时前
4-11判断素数
前端·python·算法·素数
深蓝电商API2 小时前
爬虫增量更新:基于时间戳与哈希去重
爬虫·python