Home > Mobile >  How to display clear output in terminal (VScode Python)
How to display clear output in terminal (VScode Python)

Time:04-26

When I’m executing a highlighted python code in VScode I see the output in terminal along with actual code. Is there a way to make the terminal display output only and not all lines of code associated with it?

enter image description here

CodePudding user response:

No, because it executes the selected code in interactive mode.

In order to get clean output you need to write your code to a .py file and execute it.

CodePudding user response:

You could creat a new .py file and put the code into this file. For example, I have a .py file namde Helloworld.py and one line in it.

enter image description here

Then you could run this file by click "Run python file"

enter image description here

Here is the terminal shows:

enter image description here

If the above does not work, I think there may be a problem with your default terminal settings.

enter image description here enter image description here

  • Related