codinggirl
codinggirl

Reputation: 31

exited with code=0 in 0.074 seconds - Output window has no output in Visual Studio

A simple print("Hello") will not produce any output so I'm not sure what to do. I've tried pressing ctrl+ F5 but haven't found any effective solutions beyond this. i'm using the VS Code IDE under "Code", please help.

exited with code=0 in 0.074 seconds

Image of my output terminal:

image

Upvotes: 3

Views: 48871

Answers (8)

Alejandro CM
Alejandro CM

Reputation: 137

My solution:

1. I had to make sure I was working under the virtual environment variable (venv) (I wasn't)

2. I had to save the file I was trying to run before running it Ctrl+S.

My problem:

I was running two terminals opened. In the first one I had an active server, and in the second on I was running the actual file. I was able to make it work:

Running sever (terminal 1: Python) enter image description here

Working file (Code) enter image description here

Upvotes: 0

19BEC071GAURAV NARULA
19BEC071GAURAV NARULA

Reputation: 11

Your two extensions could be running together like code runner and the official Microsoft python extensions.

What worked for me personally was to disable the code runner extension, it will say reload required do that and then your vs code will run on the official python extension which means it will work now on the initial stages.

Upvotes: 1

Kumawat Lalit
Kumawat Lalit

Reputation: 588

yes Today i faced the same problem instead of correct output getting code=0 and running The solution is in the coderunner

  1. In addition to uncheck this Execution Message Whether to show extra execution message like [Running] ... and [Done] ..

you can also check this run in integrated terminal

Upvotes: -1

Mahdi Xbzn
Mahdi Xbzn

Reputation: 11

go to settings and type this --> @ext:formulahendry.code-runner / then you should see something like Code-runner: Show Execution Message Whether to show extra execution message like [Running] ... and [Done] ... if there is a mark next to the option remove it enter image description here

Upvotes: 1

Mintu
Mintu

Reputation: 512

The reason you have been getting it is because you have code runner extension running on it. Due to which, you are getting code exited 0 error while running the python program.

Go to the Extensions -> search for (code-runner) -> Disable options (Click)

Then open the vscode and reopen it. You may then try to run the python program to get the desired results.

Upvotes: 2

fireball.1
fireball.1

Reputation: 1521

Go to the third terminal tab and run

python <filename>

The output should be visible in that space.

The output window only shows the status messages and code=0 means it ran successfully.

Upvotes: 0

Steven-MSFT
Steven-MSFT

Reputation: 8431

It seems like the 'Code Runner' extension caused it. You can try to disable it to use 'Python' extension instead.

Upvotes: 3

Hikash
Hikash

Reputation: 429

You can always open up the integrated terminal (keycode varies, but the default is ctrl+shift+` ) then run

python <file.py>

Upvotes: 0

Related Questions