在IntegratedTerminal中调试python代码时,VSCode无法读取用户输入

问题描述

在这两行python代码中:

string = input("What's your name? ")

if string != '': print('Hello,' + string + '!')

在运行调试时,它会等待用户输入。输入名称后,终端(Python调试控制台)就在那里暂停,print()行永远不会执行。 See the screenshot below

launch.json文件在下面(默认情况下):

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information,visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0","configurations": [
        {
            "name": "Python: Current File","type": "python","request": "launch","program": "${file}","console": "integratedTerminal"
        }
    ]
}

如果我在不调试的情况下运行此代码,则一切正常。

注意:调试器之前可以正常工作。这个问题是最近才发生的。 非常感谢您的帮助或提示。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)