How can I store user input from command line in Python?
<p>I am trying to run a script with up to 8 arguments. For example:</p>

<p>pythonscript.py hello there howdy do argument5 argument6 argument7 argument8</p>

<p>I want to store arguments 5-8 in an array, however, if arguments 5-8 are not entered, I want a default value assigned to a variable. I don't care if it's a tuple, the data in the input will not change.</p>

<p>I have this so far, but can't get it to work. What am I missing?</p>

<pre><code>import sys

try:
    values = (sys.argv[5],sys.argv[6],sys.argv[7],sys.argv[8])
except:
    values ='127.0.0.1'
</code></pre>
