I've seen people suggesting sys.exit() in Python.
My question is that, is there any other way to exit the execution of current script, I mean termination, with an error.
Something like this:
sys.exit("You can not have three process at the same time.")
Currently my solution would be:
print("You can not have three process at the same time.")
sys.exit()
Best Answer
Calling
sys.exit
with a string will work. The docs mention this use explicitly: