vscode debug 配置:launch.json

打开新项目左边的"运行和调试"

点击蓝色字体"创建 launch.json 文件"

选择上方"python"

选择"Python 文件 调试当前正在运行的Python文件"

配置launch.json文件内容:

json 复制代码
{
   // 使用 IntelliSense 了解相关属性
   // 悬停以查看现有属性的描述。
   // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
   "version": "0.2.0",
   "configurations": [                
       {
           "name": "Python: Current File",
           "type": "python",
           "request": "launch",
           "program": "${file}",
           "console": "integratedTerminal",
           "justMyCode": true,
           "env": {"PYDEVD_WARN_SLOW_RESOLVE_TIMEOUT": "2"},
           "cwd": "${fileDirname}",
           "args": ["./configs/xxx.yaml",
           			"--a", "A",
           			"--b", "B"
           ]         
       }
   ]
}

"justMyCode": true debug时只进入项目自带文件,不进入安装的包文件
"env": {"PYDEVD_WARN_SLOW_RESOLVE_TIMEOUT": "2"} 多长时间显示 pydevd warnings
"cwd": "${fileDirname}" 控制代码的初始路径为debug文件所在路径
"args": ["xxx", "xxx"] debug时传入的参数

相关推荐
lzj_pxxw1 天前
STM32移植FreeRTOS(Cmake+CubeMX)
vscode·stm32·嵌入式硬件
modelmd1 天前
离线安装与使用 vscode Remote SSH插件
ide·vscode·ssh
2501_916008897 天前
iOS App 图标、启动屏和多语言搭配 方法,上架前使用KXBuild一次做好 App 图标
ide·vscode·ios·objective-c·个人开发·swift·敏捷流程
2501_915918417 天前
iOS 推送通知怎么实现,从 APNs p8 密钥到 iOS 真机收到第一条推送
vscode·ios·objective-c·个人开发·swift·敏捷流程
sunshine22 girl8 天前
copilot vscode 使用技巧
人工智能·vscode·编辑器
2501_915909068 天前
Windows 打开 Xcode 工程,编译调试 Xcode 项目并和 Mac 同事协作
ide·windows·vscode·macos·ios·个人开发·xcode
2501_916007479 天前
Windows OpenSSL 生成 iOS 证书,制作 p12 与描述文件,KXBuild 签名实操
windows·vscode·ios·objective-c·个人开发·swift·敏捷流程
我要见SA姐19 天前
Chrome 内存泄漏诊断指南:从现象定位到根因排查
ide·vscode·python·自动化·编辑器
00后程序员张9 天前
Windows 开发 iOS App 入门,用 SwiftUI 写第一个 iOS App 装到 iPhone
ide·vscode·ios·objective-c·个人开发·swift·敏捷流程
Eiceblue10 天前
用 Python 给 Word 文档加水印:文字、图片与批量处理
开发语言·vscode·python·word