因爲,個人習慣將 python 的工程中,定義 main.py 並默認啓動 main 函數所在的文件;在VS code 進行如下配置:
{
// 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: 當前文件",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}\\main.py",
"console": "integratedTerminal"
}
]
}