specifying the same argument multiple times with argparse

Larry Martell larry.martell at gmail.com
Mon Apr 16 17:31:48 EDT 2018


Is there a way using argparse to be able to specify the same argument
multiple times and have them all go into the same list?

For example, I'd like to do this:

script.py -foo bar -foo baz -foo blah

and have the dest for foo have ['bar', 'baz', 'blah']


More information about the Python-list mailing list