版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/BearKChan/article/details/78758687
vscode
调试python
是可以控制台交互的
1. 下载vscode
的扩展“Python”
2. 查看一下这个扩展的官方说明DonJayamanne/pythonVSCode
3. 按照说明在调试的时候选择 Integrated Terminal/Console
4. 设置python
目录:在用户设置里找到
"python.pythonPath": "python",
在右侧修改,如:
"python.pythonPath": "C:/Users/zyc/AppData/Local/Programs/Python/Python35/Python.exe"
5. 然后点旁边的齿轮按钮打开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"
]
},