sys.exit meaning python code example
Example 1: python system exit
import sys
sys.exit(0)
Example 2: python sys.argv exception
try:
filename = sys.argv[1]
except IndexError:
print "You did not specify a file"
sys.exit(1)
import sys
sys.exit(0)
try:
filename = sys.argv[1]
except IndexError:
print "You did not specify a file"
sys.exit(1)