When run a Python file, by clicking this,
I will receive the location of the file before I get the answer:
So can someone tell me how to delete it or make it look better?
When run a Python file, by clicking this,
I will receive the location of the file before I get the answer:
So can someone tell me how to delete it or make it look better?
You can use the following two ways:
Use debug mode, and change "console"
to "internalConsole"
. Your launch.json
will look like:
{
"version": "0.2.0",
"configurations": [
{
"name": "Python",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/path/to/your_script.py",
"console": "internalConsole"
}
]
}
You can use code-runner extension if you do not want to use debug everytime. Then add the following code to your settings.json:
"code-runner.runInTerminal": false,
"code-runner.clearPreviousOutput": true,
"code-runner.showExecutionMessage": false,
In this way, you can click the Run Code button in your first picture, and the path will not be displayed each time you run file, and the last run result will be cleared automatically each time you run if you use code-runner extension.