如何在VScode中配置Python的交互式环境

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"
            ]
        },

你可能感兴趣的:(如何在VScode中配置Python的交互式环境)