I'm on VS Code for Mac OS X. Is there a way that I can have VS Code automatically clear the terminal window that shows output from the Python program each time I run it? I'd like to clear the terminal window before execution.
Edit: Looking at the suggested links, I'd like to do this with VS Code tasks. I see that I'd need to edit the tasks.json file in the .vscode directory, but how would I trigger the task each time before the Python file is run, and what other parameters would I fill in for the task?
Still a little confused here. What do I put in for "command"
and "label"
?
{
// 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",
"command": "echo Hello",
"clear": "true"
}
]
}