如何将 VS Code 默认终端更改为 python

Kum*_*ara 4 powershell python-3.x visual-studio-code

我在 Windows 10 电脑上使用 Visual Studio Code。我想将默认终端从“Windows PowerShell”更改为“Python”(在 Windows 上)。有人帮我解决这个问题。

car*_*ich 5

Ctrl+ Shift+P调出命令面板并运行Terminal: Select Default Profile命令:

运行命令

选择默认配置文件

如果此处未显示 Python,请在 JSON 配置中手动为其添加配置文件。Ctrl+ Shift+P并运行Preferences: Open User Settings (JSON)命令:

在此输入图像描述

在 JSON 配置文件中添加以下行并保存:

"terminal.integrated.profiles.windows": {
    "Python": {
        "path": "python",
        "args": []
    }
},
Run Code Online (Sandbox Code Playgroud)

之后您应该能够选择Python作为您的默认终端配置文件。