打開新項目左邊的“運行和調(diào)試”
點擊藍色字體“創(chuàng)建 launch.json 文件”
選擇上方“python”
選擇“Python 文件 調(diào)試當前正在運行的Python文件”
配置launch.json
文件內(nèi)容:文章來源:http://www.zghlxwxcb.cn/news/detail-851045.html
{
// 使用 IntelliSense 了解相關(guān)屬性
// 懸停以查看現(xiàn)有屬性的描述。
// 欲了解更多信息,請訪問: 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時傳入的參數(shù)文章來源地址http://www.zghlxwxcb.cn/news/detail-851045.html
到了這里,關(guān)于vscode debug 配置:launch.json的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!