Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pycharm exit code 0

Tags:

python

pycharm

Whenever I run any code, my console always ends with Process finished with exit code 0.

For example, if i were to just print("hellow"):

pydev debugger: process 21021 is connecting

Connected to pydev debugger (build 131.618)
hellow

Process finished with exit code 0

Is there any way to make the output just "hellow"?

like image 862
goodcow Avatar asked Dec 17 '13 21:12

goodcow


People also ask

What is process exit code 0?

Each process has an exit code that can be accessed by other processes and can be used to indicate success or failure. A process sets an exit code in the value returned from either WinMain or the "C" main function. A process could, for example, return 0 to indicate success or a non-zero value indicating an error code.

What does exit 0 do in python?

The function calls exit(0) and exit(1) are used to reveal the status of the termination of a Python program. The call exit(0) indicates successful execution of a program whereas exit(1) indicates some issue/error occurred while executing a program.

What is exit code 1 in Pycharm?

Exit Code 1 means that a container terminated, typically due to an application error or an invalid reference. An application error is a programming error in any code running within the container.

What does it mean process finished with exit code?

exit code (0) means an exit without an errors or any issues, can be a compile time error or any dependency issue. exit code (1) means there was some issue which caused the program to exit.


1 Answers

You realize it is not part of the output right? It's just additional information provided by the IDE's console. The real program is just outputting hellow as expected.

Saying that the Process finished with exit code 0 means that everything worked ok. If an exception occurs in your program or otherwise an exit is generated with non-zero argument, the IDE is gonna inform you about this, which is useful debug information.

You're not supposed to run your Python programs from the IDE when in production so I think trying to remove that is irrelevant.

like image 166
Paulo Bu Avatar answered Oct 13 '22 20:10

Paulo Bu