unable to get sys.argv[1] value
<p>I am trying to execute a very simple script.
It only prints the first argument passed.</p>

<p>The code is</p>

<pre><code>import sys
def check(argument):
  '''Open, read, and print a file.'''
  print argument

if __name__ == "__main__":
  check(sys.argv[1])
</code></pre>

<p>however when i execute from command line, i always get this error</p>

<pre><code>C:\&gt;sample.py myname

Traceback (most recent call last):
  File "C:\sample.py", line 7, in &lt;module&gt;
    check(sys.argv[1])
IndexError: list index out of range
</code></pre>

<p>Any help</p>
