使用VSCode调试代码的时候,如果所调用的模块是内置模块,就无法setp-into,会在右下角看到如下报错
此时我们需要修改launch.json
1.可以使用ctrl+shift+P搜索launch.json,打开此文件,然后将下面代码复制到里面保存即可。
2.如果使用ctrl+shift+P找不到launch.json,则在左侧点击debug,然后点击create a launch.json file.选择Python file
3.launch.json里面内容如下:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: 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": false,
// "purpose": ["debug-in-terminal"]
}
]
}