python, sys arguments parse, example code
Example 1: how to get command line arguments in python
import sys
print 'Number of arguments:', len(sys.argv), 'arguments.'
print 'Argument List:', str(sys.argv)
Example 2: argparse python
def create_parser(arguments):
"""Returns an instance of argparse.ArgumentParser"""
parser = argparse.ArgumentParser(
description="Description of your code")
parser.add_argument("argument", help="mandatory or positional argument")
parser.add_argument("-o", "--optional",
help="Will take an optional argument after the flag")
namespace = parser.parse_args(arguments)
return namespace