赞
踩
本博文记录毛毛张在VScode
使用过程中,如何编写调试Vscode
的launch.json
文件。
在VSCode中进行调试Python脚本通常需要创建一个调试配置文件。以下是一些步骤,可以帮助你在VSCode中调试这个Python脚本:
.vscode
的文件夹,如果该文件夹不存在的话。.vscode
文件夹中创建一个名为launch.json
的文件,用于配置调试器。launch.json
中添加一个配置项,例如:{ "version": "0.2.0", "configurations": [ { "name": "Debug MyScript", "type": "python", "request": "launch", "program": "${workspaceFolder}/preprocess/preprocess_retriever_data.py", "args": [ "--query_file","data/instruction/G1_query.json", "--index_file","data/test_query_ids/G1_instruction_test_query_ids.json", "--dataset_name","G1", "--output_dir","data/retrieval/G1" ], "console": "integratedTerminal" } ] }
请确保修改program
和args
字段的值以匹配你的项目结构和文件路径。
F5
或者通过菜单选择Run > Start Debugging
来启动调试器。integratedTerminal
中显示输出。Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。