Why is my Python script not running via command line?
<p>Thanks!</p>

<pre><code>def hello(a,b):
    print "hello and that's your sum:"
    sum=a+b
    print sum
    import sys

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

<p>It does not work for me, I appreciate the help!!! 
Thanks!</p>

<p>Without seeing your error message it's hard to say exactly what the problem is, but a few things jump out:</p>

<ul>
<li>No indentation after if __name__ == "__main__":</li>
<li>you're only passing one argument into the hello function and it requires two.</li>
<li>the sys module is not visible in the scope outside the hello function.</li>
</ul>

<p>probably more, but again, need the error output.</p>

<p>Here's what you might want:</p>

<pre><code>import sys

def hello(a,b):
    print "hello and that's your sum:"
    sum=a+b
    print sum

if __name__ == "__main__":
    hello(int(sys.argv[1]), int(sys.argv[2]))
</code></pre>

python