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.
<
I know this is an old thread, however you can also raise an error like this:
raise SystemExit('Error: 3 processes cannot run simultaneously.')
One advantage of this approach is that you don't have to import the Python sys module. This works on Linux with Python 3 and Python 2. I have not tested it on Windows or Mac OS.