Run Python function with input arguments from command line
<p>My function convert.py is:</p>
<pre><code>def convert(a,b)
  factor = 2194.2
  return (a-b)*factor
</code></pre>
<p>How do I run it from the command line with input arguments <code>a</code> and <code>b</code>?<br>
I tried:</p>
<pre><code>python convert.py 32 46
</code></pre>
<p>But got an error.</p>
<p>I did try to find the answer online, and I found related things but not the answer:</p>
<ol>
<li><a href="https://stackoverflow.com/questions/3987041/python-run-function-from-the-command-line">Run function from the command line</a> (Stack Overflow)</li>
<li><a href="https://stackoverflow.com/questions/1009860/command-line-arguments-in-python">How to read/process command line arguments?</a>  (Stack Overflow)</li>
<li><a href="http://www.cyberciti.biz/faq/python-command-line-arguments-argv-example/" rel="nofollow noreferrer">http://www.cyberciti.biz/faq/python-command-line-arguments-argv-example/</a></li>
<li><a href="http://www.saltycrane.com/blog/2007/12/how-to-pass-command-line-arguments-to/" rel="nofollow noreferrer">http://www.saltycrane.com/blog/2007/12/how-to-pass-command-line-arguments-to/</a></li>
</ol>
<p>Also, where can I find the answer myself so that I can save this site for more non-trivial questions?</p>