Created
November 2, 2017 14:00
-
-
Save tadone/58f6c2e3a20bf8e55ea1795435b7f259 to your computer and use it in GitHub Desktop.
[Exit Script] #python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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