In visual studio code I want run simple python code (using the code runner extension)
and it gives me info about runtime and where the file is. I don't want that, can I cut it out and only have the output?
Asked
Active
Viewed 1,141 times
3

yes
- 33
- 6
-
Are you executing your python from the Run menu in Visual Studio Code? If so, then the system info you are seeing -- most likely -- comes from bash or powershell (depending on which one you are using). That behavior would be independent of Visual Studio Code. You should see the same system info when you invoke either of those terminals outside of Visual Studio Code. – jim Feb 21 '21 at 19:47
-
1@jim that's not bash or powershell - that's the native vscode output – SuperStormer Feb 21 '21 at 20:12
-
change output tag to terminal tag. In terminal, run python -u "hello world.py" – Benjaminliupenrose Feb 21 '21 at 20:21
-
1@jim Just to clarify, that's actually not the native/built-in VS Code output, that is from the [Code Runner](https://marketplace.visualstudio.com/items?itemName=formulahendry.code-runner) extension. The native VS Code output for Python [does not look like that](https://code.visualstudio.com/docs/python/python-tutorial#_run-hello-world) (does not have [Running] and [Done] tags). – Gino Mempin Feb 22 '21 at 00:00
-
Does this answer your question? [How to hide file paths when running Python scripts in VS Code?](https://stackoverflow.com/questions/61176552/how-to-hide-file-paths-when-running-python-scripts-in-vs-code) – Gino Mempin Feb 22 '21 at 00:01
-
@Pictographary -How are things going? Just checking in to see if the information provided was helpful. – Jill Cheng Mar 05 '21 at 08:40
-
@Picographary, undelete you post [here](https://stackoverflow.com/questions/67268580/how-to-delete-all-the-folders-without-deleting-the-directory-itself#67268898) as I added a solution on your behalf, I will remove my downvote as well. – Gerhard Apr 26 '21 at 15:17
-
@Jill Cheng Good! the info you gave me was pretty helpful thanks for the help again – yes Apr 28 '21 at 18:51
1 Answers
2
Since you use the "Code Runner" extension, we can set it:
- We can add the following settings in "
settings.json
":
"code-runner.showExecutionMessage": false,
Run:

Jill Cheng
- 9,179
- 1
- 20
- 25
-
Will the above still allow if the python code is asking for user input? – Michael1775 May 01 '21 at 14:18
-
@Jarhead1775 -This is the "output" terminal, so it only supports the output of the result, the input terminal needs to be in "Terminal". – Jill Cheng May 04 '21 at 01:08