【问题标题】:Why cant I take user input in VS code?为什么我不能在 VS 代码中接受用户输入?
【发布时间】:2020-05-20 19:25:07
【问题描述】:

如何在 VS 代码中获取用户输入? 这是我的 launch.json 文件:

{
"version": "0.2.0",
"configurations": [
    {
        "name": "Python",
        "type": "python",
        "request": "launch",
        "stopOnEntry": true,
        "pythonPath": "${config:python.interpreterPath}",
        "program": "${file}",
        "debugOptions": [
            "WaitOnAbnormalExit",
            "WaitOnNormalExit",
            "RedirectOutput"
        ],
        "console": "integratedTerminal"
    }
]}

我还需要做什么?

【问题讨论】:

  • 您尝试使用什么代码来获取用户输入?你试过foo = input()吗?调试开始后尝试输入一些内容并按回车
  • 这已经有答案了here
  • 这能回答你的问题吗? Visual Studio Code: Take Input From User

标签: visual-studio-code user-input


【解决方案1】:

设置这个。

{
    "code-runner.runInTerminal": true
}

这个问题几乎可以肯定是this的骗子

【讨论】:

    猜你喜欢
    • 2022-11-17
    • 2021-12-25
    • 2020-09-26
    • 2017-01-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多