David542
David542

Reputation: 110163

How to make return value 0 of a script

I have a script that triggers another script:

exit_status = subprocess.call([RUN_SCRIPT)]
if exit_status: # if successful output
    # do something
else: # if script is not successful
    # send email to admins

# RUN_SCRIPT
if return_value < error_threshold:
    # return exit status = 1
if return_value > error_threshold:
    # return exit status = 0

How would I do this?

Upvotes: 0

Views: 150

Answers (1)

James
James

Reputation: 8586

http://docs.python.org/library/sys.html

sys.exit(0) / sys.exit(1)

Upvotes: 7

Related Questions