参考此篇博客https://blog.csdn.net/u013205877/article/details/78883405
task.json:
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "echo",
"type": "shell",
"args": [
"${file}"
],
"command": "/home/wujunjie/anaconda2/envs/py366/bin/python",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
setting:
{
"python.pythonPath":"/home/wujunjie/anaconda2/envs/py366/bin/python",
"python.linting.pylintPath":"/home/wujunjie/anaconda2/envs/py366/bin/pylint"
}
lauch:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File (Integrated Terminal)",
"type": "python",
"request": "launch",
"stopOnEntry":true,
"program": "${file}",
"python.pythonPath":"/home/wujunjie/anaconda2/envs/py366/bin/python",
"cwd":"${workspaceFolder}",
"env":{},
"envFile":"${workspaceFolder}/.env",
"debugOptions":["RedirectOutput"]
},
{
"name": "Python: Attach",
"type": "python",
"request": "attach",
"port": 5678,
"host": "localhost"
},
{
"name": "Python: Module",
"type": "python",
"request": "launch",
"module": "enter-your-module-name-here",
"console": "integratedTerminal"
},
{
"name": "Python: Django",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/manage.py",
"console": "integratedTerminal",
"args": [
"runserver",
"--noreload",
"--nothreading"
],
"django": true
},
{
"name": "Python: Flask",
"type": "python",
"request": "launch",
"module": "flask",
"env": {
"FLASK_APP": "app.py"
},
"args": [
"run",
"--no-debugger",
"--no-reload"
],
"jinja": true
},
{
"name": "Python: Current File (External Terminal)",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "externalTerminal"
}
]
}