Hi this has a problem with the last "else:" in the python code and I am not sure why? I am a massive newbie to scripting so any help would be great?
python pythontest.py
File "pythontest.py", line 24
else:
^
SyntaxError: invalid syntax
Thanks
Code:
#!/usr/bin/python
import sys
import re
#assigns a variable
len1 = len(sys.argv)
if len1 <2:
print ("Need at least 1 ARG: Supplied", len1, "ARGS", sys.argv[0])
exit(200)
elif len1 >2:
print ("You have supplied too many ARGS", len1, )
exit("TOO MANY ARGS")
else:
print ("You have supplied", len1, " ARGS")
#pass keeps script going without doing anything
pass
exit()
if re.search('^\d*$', sys.argv[1]):
print("MATCH")
else:
print ("NO MATCH")
exit (200)
print ("You have passed!")