35

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"?

3 Answers 3

57

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.

2
  • 3
    why are you not supposed to run Python programs from the IDE in production? Where would be a good place to run them? Mar 9, 2018 at 8:46
  • 2
    I guess you don't know what is "production"? The users of your software will not use an IDE, but run it in a browser etc.
    – Greg Holst
    May 7, 2019 at 13:28
0

I got the same error and reason in my case was that previous python script was running through Pycharm. To resolve this, trying stopping all previous running scripts from Pycharm then run your current script. This may be helpful.

0
-5

If you stop your script and it throws an exception you can add the following except that returns the same message.

except KeyboardInterrupt:
    sys.exit(0)

Returns

Process finished with exit code 0
1
  • Process finished with exit code 0 means everything worked well. https://stackoverflow.com/questions/20645129/pycharm-exit-code-0
    – Snipper03
    Jul 29, 2018 at 3:38

Not the answer you're looking for? Browse other questions tagged or ask your own question.