【问题标题】:How to change VS Code Default Terminal to python如何将 VS Code 默认终端更改为 python
【发布时间】:2022-01-06 11:51:47
【问题描述】:

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

【问题讨论】:

  • 这能回答你的问题吗? VSCode Change Default Terminal
  • 不,我希望 python 作为我的默认终端,这个建议给出了一个常见的答案,但不适用于 python。如果我可以将 python 设置为我的默认终端,请详细说明。因为我是编程语言的新手

标签: python-3.x powershell visual-studio-code


【解决方案1】:

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

如果此处没有出现 Python,请在您的 JSON 配置中手动add a profile for it。按 Ctrl+Shift+P 并运行Preferences: Open Settings (JSON) 命令:

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

"terminal.integrated.profiles.windows": {
    "Python": {
        "path": "python",
        "args": []
    }
},

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

【讨论】:

  • 对不起,我试过这个方法,但没有显示我要求的方法。
  • 您的意思是它不显示 Python 作为选项吗?你有安装 Python 吗?
  • 是的,它不显示 python 作为选项,但我已经安装了 python。
  • 好吧,我用如何添加 Python 终端配置文件的信息扩展了我的答案。
  • 谢谢你的回答它解决了我的问题:)
猜你喜欢
  • 2021-11-01
  • 1970-01-01
  • 1970-01-01
  • 2021-08-17
  • 2021-05-02
  • 2017-08-11
  • 2016-01-30
  • 2023-03-09
  • 2017-08-18
相关资源
最近更新 更多