Python program with arguments on Windows
<p>How to run this program saved in the file test.py on Windows XP with python 2.7 installed.</p>

<pre><code>import argparse
parser = argparse.ArgumentParser(description='Process some integers.')
parser.add_argument('integers', metavar='N', type=int, nargs='+',help='an integer for the accumulator')
parser.add_argument('--sum', dest='accumulate', action='store_const',const=sum, default=max,help='sum the integers (default: find the max)')
args = parser.parse_args()
print args.accumulate(args.integers)
</code></pre>

<p>I tried to run it with command line. For example</p>

<pre><code>$ python test.py 1 2 3 4
</code></pre>

<p>or</p>

<pre><code>$ python test.py 1 2 3 4 --sum
</code></pre>

<p>gives error "invalid syntax".</p>