parser.add_argument('integers', metavar='N', type=int, nargs='+', help=
    'an integer for the accumulator')
How to use getopt/OPTARG in Python? How to shift arguments if too many arguments (9) are given?