Question: ```
import os

commands = ['uname -v', 'whoami']

a = 0  
numberIterations = 2    # How to make a command line argument of a while loop number?  
while a < numberIterations:  
    print "#--- Iteration: %s ---#" % a  
    i = 0  
    while i < len(commands):  
        print "$", commands[i]  
        os.system(commands[i])  
        i = i + 1  
    print ""  
    a = a + 1  

```

I want to run the script in this format:  

`./script.py "numberIterations"`

Answer: 
Grab the `str` from `sys.argv` and convert it to an `int`.

```
import sys
try:
  numberIterations = int(sys.argv[1])
except IndexError:
  print "Usage: %s numberIterattions" % sys.argv[0]
  raise SystemExit(1)

```
```
import sys

```

`sys.argv` contains the arguments from the command line

<http://www.tutorialspoint.com/python/python_command_line_arguments.htm>