vscode帶命令行參數(shù)進(jìn)行調(diào)試的方法
vscode帶命令行參數(shù)進(jìn)行調(diào)試
1
2.輸入代碼
{ // 使用 IntelliSense 了解相關(guān)屬性。 // 懸停以查看現(xiàn)有屬性的描述。 // 欲了解更多信息,請訪問: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "Python: 當(dāng)前文件", "type": "python", "request": "launch", "program": "${file}", "console": "integratedTerminal", // "env": {"CUDA_VISIBLE_DEVICES":"0,1,2,3"}, "args": [ "--train --config=configs/lane_detection/resa/erfnet_tusimple.py" ] } ] }
上述程序帶的命令行參數(shù):--train --config=configs/lane_detection/resa/erfnet_tusimple.py
啟動的方式就是:首先打開你要運行的文件,然后點擊即可
2022-5-13 08:30:28 :對上述launch.json編寫的方式現(xiàn)在換了個新的:
{ // 使用 IntelliSense 了解相關(guān)屬性。 // 懸停以查看現(xiàn)有屬性的描述。 // 欲了解更多信息,請訪問: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { // python main_landet.py --train --config=configs/lane_detection/resa/erfnet_tusimple.py "name": "Train_erfnet_tusimple", "type": "python", "request": "launch", "program": "main_landet.py", "args": [ "--train", "--config=configs/lane_detection/resa/erfnet_tusimple.py" ], "console": "internalConsole", "justMyCode": true }, { // python main_landet.py --test --config=configs/lane_detection/resa/erfnet_tusimple.py "name": "Test_erfnet_tusimple", "type": "python", "request": "launch", "program": "main_landet.py", "args": [ "--test", "--config=configs/lane_detection/resa/erfnet_tusimple.py" ], "console": "internalConsole", "justMyCode": true }, ] }
json文件里面指定了運行哪個文件,可以按F5直接運行,而不用再打開要運行的文件了。
到此這篇關(guān)于vscode帶命令行參數(shù)進(jìn)行調(diào)試的方法的文章就介紹到這了,更多相關(guān)vscode帶命令行參數(shù)進(jìn)行調(diào)試內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
python 提取tuple類型值中json格式的key值方法
今天小編就為大家分享一篇python 提取tuple類型值中json格式的key值方法,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2018-12-12python通過get,post方式發(fā)送http請求和接收http響應(yīng)的方法
這篇文章主要介紹了python通過get,post方式發(fā)送http請求和接收http響應(yīng)的方法,涉及Python使用urllib模塊與urllib2模塊實現(xiàn)get與post發(fā)送數(shù)據(jù)的相關(guān)技巧,需要的朋友可以參考下2015-05-05Python內(nèi)建類型dict深入理解源碼學(xué)習(xí)
這篇文章主要為大家介紹了Python內(nèi)建類型dict的深入理解及源碼學(xué)習(xí),有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-03-03python使用json將字符串轉(zhuǎn)字典報錯的解決
這篇文章主要介紹了python使用json將字符串轉(zhuǎn)字典報錯的解決方案,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教2023-02-02Python?Flask實現(xiàn)快速構(gòu)建Web應(yīng)用的方法詳解
Flask是一個輕量級的Web服務(wù)器網(wǎng)關(guān)接口(WSGI)web應(yīng)用框架,本文將和大家一起詳細(xì)探討一下Python?Flask?Web服務(wù),需要的小伙伴可以學(xué)習(xí)一下2023-06-06