pythonreference.com

search statements, functions, methods, exceptions*

show categories

try/except
handle specified exception and run routine
try:
    arg = sys.argv[1]

except IndexError:
    exit('enter an arg')