Answers for "arg parse array argument"

0

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']
Posted by: Guest on September-22-2020
0

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
Posted by: Guest on April-13-2020

Python Answers by Framework

Browse Popular Code Answers by Language