如何让 Visual Studio Code 中的 Code Runner 扩展使用选定的 Python 解释器?

Gol*_*Jer 1 python coderunner vscode-code-runner

我想使用Code Runner扩展在 vscode 中快速运行活动的 python 文件。

当我运行它时,我收到消息...

未找到 Python,但可以从 Microsoft Store 安装:https : //go.microsoft.com/fwlink?linkID=2082640

我希望 Code Runner 使用活动的 vscdode Python 解释器。如何?

Gol*_*Jer 7

这需要一些时间才能找到,所以我想我会在这里发布问答以供将来的搜索者使用。

来自这个 github 帖子
打开您的settings.json文件并添加此设置。

"code-runner.executorMap": {
  "python":"$pythonPath $fullFileName",
}
Run Code Online (Sandbox Code Playgroud)