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 ap
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)