1#!/usr/bin/python
2
3import sys
4
5print('Number of arguments:', len(sys.argv), 'arguments.')
6print('Argument List:', str(sys.argv))
1import argparse
2
3parser = argparse.ArgumentParser(description='Process some integers.')
4parser.add_argument('integers', metavar='N', type=int, nargs='+',
5 help='an integer for the accumulator')
6parser.add_argument('--sum', dest='accumulate', action='store_const',
7 const=sum, default=max,
8 help='sum the integers (default: find the max)')
9
10args = parser.parse_args()
11print(args.accumulate(args.integers))
12