Robert Kern wrote:
> On 3/30/11 10:32 AM, Neal Becker wrote:
>> I'm trying to combine 'choices' with a comma-seperated list of options, so I
>> could do e.g.,
>>
>> --cheat=a,b
>>
>> parser.add_argument ('--cheat', choices=('a','b','c'), type=lambda x:
>> x.split(','), default=[])
>>
>> test.
On 3/30/11 10:32 AM, Neal Becker wrote:
I'm trying to combine 'choices' with a comma-seperated list of options, so I
could do e.g.,
--cheat=a,b
parser.add_argument ('--cheat', choices=('a','b','c'), type=lambda x:
x.split(','), default=[])
test.py --cheat a
error: argument --cheat: inva
I'm trying to combine 'choices' with a comma-seperated list of options, so I
could do e.g.,
--cheat=a,b
parser.add_argument ('--cheat', choices=('a','b','c'), type=lambda x:
x.split(','), default=[])
test.py --cheat a
error: argument --cheat: invalid choice: ['a'] (choose from 'a', 'b',