argparse doesn't check for positional arguments
I'm creating a script that takes both positional and optional arguments with argparse. I have gone through Doug's tutorial and the python Docs but can't find an answer. parser = argparse.ArgumentParser(description='script to run') parser.add_argument('inputFile', nargs='?', type=argparse.FileType('rt'), parser.add_argument('inputString', action='store', nargs='?') parser.add_argument('-option1', metavar='percent', type=float, action='store') parser.add_argument('-option2', metavar='outFile1', type=argparse.FileType('w'), parser.add_argument('-option3', action='store', default='<10', args =