I am new to PyCharm and I have 'Process finished with exit code 0' instead of getting (683, 11) as a result (please see attachment), could you guys help me out please? Much appreciate it!
Process - Exit (Code|Status) The exit code or exit status is a number returned by a process created by a command line indicating if there was an error or not. 0 means that there is no error. an other value means that there was an error.
Make sure the file that you want to run is on top. Hit ctrl+shift+F10 to run. The run button should be enabled again.
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.
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.
That is good news! It means that there is no error with your code. You have run it right through and there is nothing wrong with it. Pycharm returns 0 when it has found no errors (plus any output you give it) and returns 1 as well as an error message when it encounters errors.
Editors and scripts do not behave like the interactive terminal, when you run a function it does not automatically show the the result. You need to actually tell it to do it yourself.
Generally you just print the results.
If you use print(data.shape)
it should return what you expect with the success message Process finished with exit code 0
.
exit code 0
means you code run with no error.
Let's give a error code
for example(clearly in the below image): in below code, the variable lst
is an empty list,
but we get the 5 member in it(which not exists), so the program throws IndexError
, and exit 1
which means there is error with the code.
You can also define exit code for analysis, for example:
ERROR_USERNAME, ERROR_PASSWORD, RIGHT_CODE = 683, 11, 0
right_name, right_password = 'xy', 'xy'
name, password = 'xy', 'wrong_password'
if name != right_name:
exit(ERROR_USERNAME)
if password != right_password:
exit(ERROR_PASSWORD)
exit(RIGHT_CODE)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With