title: How do you pass a variable to python function from CLI
body: <p>Using the CLI: how to I pass a parameter to TOC.action function
  of <code>[1, 'happy']</code> or <code>[2, 'sad']</code>
  I tried:</p>
  <blockquote>
  <p>python TOC.action.py [1, &quot;happy&quot;]</p>
  <p>python TOC.py [1, &quot;happy&quot;]</p>
  </blockquote>
  <p>TOC.py</p>
  <pre><code>#!/usr/bin/python
  import sys
     
  def one(var):
      print var
  
  def two(var):
      print var
  
  def main(do):
      print &quot;now what&quot;
      print do[0]
      if do[0]==1: one(do[1])
      if do[0]==2: two(do[1]) 
      
  if __name__ == '__main__':
      main(argv)
      print 'Argument List:', str(sys.argv)
  </code></pre>