import sys print(sys.argv) More specifically, if you run python example.py one two three: >>> import sys >>> print(sys.argv) ['example.py', 'one', 'two', 'three']