如何在 VScode 中配置 Python 的交互式命令环境
1个回答
展开全部
vscode调试python是可以控制台交互的
下载vscode的扩展“Python”
查看一下这个扩展的官方说明 DonJayamanne/pythonVSCode
按照说明在调试的时候选择 Integrated Terminal/Console
设置python目录:在用户设置里找到
"python.pythonPath": "python",在右侧修改,如:
"python.pythonPath": "C:/Users/zyc/AppData/Local/Programs/Python/Python35/Python.exe"然后点旁边的齿轮按钮打开launch.json,找到Integrated Terminal/Console对应的设置修改
{
"name": "Integrated Terminal/Console",
"type": "python",
"request": "launch",
"stopOnEntry": true,
"pythonPath": "${config.python.pythonPath}",
"program": "${file}",
"cwd": "${workspaceRoot}",
"console": "integratedTerminal",
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit"
]
},应该就可以了
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询