title: Python command line parameters
body: <p>I am just starting with python so I am struggling with a quite simple example. Basically I want pass the name of an executable plus its input via the command line arguments, e.g.:</p>
  
  <pre><code>python myprogram refprogram.exe refinput.txt
  </code></pre>
  
  <p>That means when executing <code>myprogram</code>, it executes <code>refprogram.exe</code> and passes to it as argument <code>refinput</code>. I tried to do it the following way:</p>
  
  <pre><code>import sys, string, os
  print sys.argv
  
  res = os.system(sys.argv(1)) sys.argv(2)
  print res
  </code></pre>
  
  <p>The error message that I get is:</p>
  
  <pre><code>res = os.system(sys.argv(1)) sys.argv(2)
                             ^
  SyntaxError: invalid syntax
  </code></pre>
  
  <p>Anyone an idea what I am doing wrong?</p>
  
  <p>I am running Python 2.7</p>