【发布时间】: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