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时传入的参数

相关推荐
莫卢俊德2 天前
vscode ssh config
ide·vscode·ssh
郝学胜-神的一滴3 天前
Effective Python 条款44:善用属性注解
开发语言·c++·vscode·python·算法·stl
郝学胜-神的一滴8 天前
Effective STL 条款 07:指针容器销毁前先删除
开发语言·c++·vscode·leetcode·rpc·visual studio
aaaameliaaa9 天前
VSCode的安装与配置
ide·笔记·vscode·编辑器
Star(up up up)10 天前
MySQL 事务隔离级别是如何实现的?从 MVCC 到锁机制原理详解
笔记·vscode·sql·学习·程序人生·mysql·学习方法
拼图20919 天前
VSCode 正则表达式使用指南
ide·vscode·正则表达式
小李不困还能学20 天前
VSCode_RemoteSSH_一直卡在下载服务器_解决教程
服务器·ide·vscode
lzj_pxxw22 天前
STM32移植FreeRTOS(Cmake+CubeMX)
vscode·stm32·嵌入式硬件
modelmd23 天前
离线安装与使用 vscode Remote SSH插件
ide·vscode·ssh
2501_916008891 个月前
iOS App 图标、启动屏和多语言搭配 方法,上架前使用KXBuild一次做好 App 图标
ide·vscode·ios·objective-c·个人开发·swift·敏捷流程