I have already seen this question: How to execute Python code from within Visual Studio Code
But all those answers are about tasks from old versions ("0.1.0" or "0.2.0"). VS Code is now version "2.0.0" and some parameters have changed.
I'm trying to create this task through Run Task
:
tasks.json:
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Run File",
"command": "python ${file}",
"problemMatcher": [],
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
But it does not work! Error message:
Terminal with ID 8 does not exist (has it already been disposed?)
What can be wrong here?
I can use Run Python File in Terminal
or just enter python myFile.py
in Terminal - both of them work!