parse args add to list code example
Example 1: arg parse array argument
parser.add_argument("--list", nargs="+", default=["a", "b"])
SHELL
$ python3 example.py --list a b c
# List would look like ['a','b','c']
Example 2: parser.add_argument array python
parser.add_argument('-l','--list', nargs='+', help='<Required> Set flag', required=True)
# Use like:
# python arg.py -l 1234 2345 3456 4567