Skip to content

Instantly share code, notes, and snippets.

@tadone
Created November 2, 2017 14:00
Show Gist options
  • Save tadone/58f6c2e3a20bf8e55ea1795435b7f259 to your computer and use it in GitHub Desktop.
Save tadone/58f6c2e3a20bf8e55ea1795435b7f259 to your computer and use it in GitHub Desktop.
[Exit Script] #python
# To exit a script you can use:
import sys
sys.exit()
# You can also provide an exit status value, usually an integer.
import sys
sys.exit(0)
# Exits with zero, which is generally interpreted as success. Non-zero codes are usually treated as errors. The default is to exit with zero.
import sys
sys.exit("aa! errors!")
# Prints "aa! errors!" and exits with a status code of 1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment