Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

argparse multiple arguments as list

parser.add_argument('-l','--list', nargs='+', help='<Required> Set flag', required=True)
# Use like:
# python arg.py -l 1234 2345 3456 4567
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #argparse #multiple #arguments #list
ADD COMMENT
Topic
Name
1+9 =