examples/basics/cli.py
from __future__ import print_function, division
import sys

print(sys.argv)
print(sys.argv[0])
print(sys.argv[1])
print(sys.argv[2])

$ python examples/basic/cli.py one two
examples/basics/cli.py.out
['examples/basics/cli.py', 'one', 'two']
examples/basics/cli.py
one
two
$ python examples/basic/cli.py
examples/basics/cli.py.err
['examples/basics/cli.py']
examples/basics/cli.py
Traceback (most recent call last):
  File "examples/basics/cli.py", line 6, in <module>
    print(sys.argv[1])
IndexError: list index out of range