I am trying to run a script with up to 8 arguments. For example:
pythonscript.py hello there howdy do argument5 argument6 argument7 argument8
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.
I have this so far, but can't get it to work. What am I missing?
import sys
try:
values = (sys.argv[5],sys.argv[6],sys.argv[7],sys.argv[8])
except:
values ='127.0.0.1'