I have several optional arguments and one of them needs to store multiple values – i.e. its type is neither string nor integer. Does argparse support optional arguments of other types?
For example, I would like this command:
>>> python example1 test_project --name try1 3
to be the equivalent of code like this:
args.name = {'try1', '3'}
Is this possible? Or will I be forced to use action='store_true' and then prompt the user for more information if he choose this option?
I’m really having a hard time following your question. Is this what you want?
If it isn’t, perhaps you could try to be a little more clear with what you want to make argparse do, and what you’ve been able to do with it.