Reputation: 31
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:
Upvotes: 3
Views: 48871
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)
Upvotes: 0
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
Reputation: 588
yes Today i faced the same problem instead of correct output getting code=0 and running The solution is in the coderunner
you can also check this run in integrated terminal
Upvotes: -1
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
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
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
Reputation: 8431
It seems like the 'Code Runner' extension caused it. You can try to disable it to use 'Python' extension instead.
Upvotes: 3
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