我刚刚为Python安装了visual-studio-code,并且可以运行脚本,但不能与控制台交互。如果我尝试执行print()
或input()
,则会出现以下错误:
Exception has occurred: AttributeError
'NoneType' object has no attribute 'write'
我的launch.json对于终端如下所示:
{
"name": "Python: Terminal (integrated)",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
}
这会导致错误: print('Hello')