Reputation: 473
I tried some of the solutions posted earlier in similar questions but none of them seem to work for me. My code is in Python 3.8 and I am using the latest version of VSCode. Thanks.
Upvotes: 0
Views: 11090
Reputation: 159
Install "Code Runner" extension.
Setting up Code Runner
Running Python Scripts
If you want to clear previous output (from OUTPUT window) -> File -> Preferences -> Settings (Ctrl+,) -> text box "Search settings" -> Code Runner -> ensure that checkbox for "Code-runner: Clear Previous Output" is checked.
Upvotes: 0
Reputation: 11
Make sure you've the code runner extension installed. If yes then,enter image description here Go to settings , 1.search Terminal 2. scroll to the last line 3. uncheck code run in terminal
Upvotes: 1
Reputation: 10372
When running python code in VS Code, it executes the running command in the VS Code internal terminal ( TERMINAL
) by default. It is a terminal that allows user interaction, but "OUTPUT
" is an output terminal, which cannot receive user input.
For how to make the output display in "OUTPUT
" in VS Code:
Please use the "Code Runner
" extension in VS Code, which uses "OUTPUT
" by default:
In addition, if you want to use relatively clean output, you could also use "DEBUG CONSOLE
".
Please use in "launch.json": "console": "internalConsole",
then click F5
to debug the code:
Upvotes: 1