使用 VSCode,我可以通过按右上角的播放图标来运行我的测试 python 代码。
这应该=无需调试即可运行,但我没有得到任何输出
我尝试将 python 路径添加到 settings.json 中
但没有变化。
不是一个大问题,但有任何非解决方案。
我修复了:重新安装调试器(在我的例子中为 IntelliSense)
我还在您的帖子中更新了新答案。
您可以在setting.json中通过添加以下代码来指定shell:
"terminal.integrated.shell.windows":"C:\\WINDOWS\\system32\\cmd.exe",
当然,这种方法已经过时了,我们也会收到警告(但不会影响其有效性):
根据文档的更新,我们可以通过以下方式命名终端并指定默认终端:
{
"terminal.integrated.profiles.windows": {
"My PowerShell": {
"path": "pwsh.exe",
"args": [
"-noexit",
"-file",
"${env:APPDATA}\PowerShell\my-init-script.ps1"
]
}
},
"terminal.integrated.defaultProfile.windows": "My PowerShell"
}