>> python script.py var1 var2  import sys   # contains the script name sys.argv[0]  # contains the first variable (var1) sys.argv[1]   # contains the second variable (var2) sys.argv[2]

Read more of this post