Re: specifying the same argument multiple times with argparse

2018-04-16 Thread Larry Martell
On Mon, Apr 16, 2018 at 6:19 PM, Gary Herron wrote: > On 04/16/2018 02:31 PM, larry.mart...@gmail.com wrote: >> >> 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.p

Re: specifying the same argument multiple times with argparse

2018-04-16 Thread Gary Herron
On 04/16/2018 02:31 PM, larry.mart...@gmail.com wrote: 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', 'b

Re: specifying the same argument multiple times with argparse

2018-04-16 Thread Peter Otten
Larry Martell wrote: > 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? action="append" > 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

specifying the same argument multiple times with argparse

2018-04-16 Thread Larry Martell
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'] -- https://mail.python.org/mailman/listinfo