title: python sys.argv can't get the argument value?
body: <p>I tried to pass some variables to my python code . the variable is a list, after i run the python script . which is simply just print out sys.argv. the output is following:</p>
  
  <pre><code>:~ xxx$ /var/folders/kg/qxxxxxd343433gq/T/Cleanup\ At\ Startup/pdTry-375321896.860.py.command ; exit;
  var1, var2, var1, var2
  the len argv is 1
  /Users/xxx/python/pdTry.py
  Traceback (most recent call last):
  File "/Users/xxx/python/pdTry.py", line 58, in &lt;module&gt;
  main()
  File "/Users/xxx/python/pdTry.py", line 33, in main
  print (sys.argv[1])
  IndexError: list index out of range
  logout
  </code></pre>
  
  <p>you can see the the list contains var1 and var2 actually print out 2 times. but i can get the value, the len sys.argv is 1. No value for sys.argv[1]. Do anyone know why? Why the length is 1, should it be 2? arg[0] is the script name, and arg[1] is the variable list i passed to it?</p>
  
  <p>The code is simply </p>
  
  <pre><code> def main():
     os.system ('osascript up.scpt')
     #print (sys.argv)
     a= 'the len is '+str(len(sys.argv))
     print (a)
     print (sys.argv[0])
     print (sys.argv[1])
  </code></pre>