I have been having trouble using argv in the module sys in python, I would like to have a script that takes options like a program like vim or another program that takes arguments like -t or something like that. in those kinds of programs you have have one argument or more. If i want one argument it gives me a value error, is there a way to have one option or more using argv? if not how do programs like ls or vim use options?
import sys
argv = sys.argv
script, option1, option2, option3 = argv
if option1 or option2 or option3 == '--help':
print 'Help will be added after the script is finished W-I-P'
elif option1 or option2 or option3 == '':
print 'if you need help type time.py --help'
else:
print 'Syntax error refer to --help for options'
thanks!