How to add external arguments in python script?
<p>I want the user to provide some external arguments while calling a python script from command line, what changes I suppose to make inside my python script to add this functionality?</p>

<p>I think this is what you are looking for</p>

<p>pass arguments in command line.</p>

<pre><code>$ python test.py arg1 arg2 arg3
</code></pre>

<p>access it using sys.argv which gives list of arguments that you entered above</p>

<pre><code>import sys

print 'Number of arguments:', len(sys.argv), 'arguments.'
print 'Argument List:', str(sys.argv)
</code></pre>

python command-line-interface