argparse presence of switch

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Jan 13 00:16:34 EST 2021


On 13/01/21 7:13 am, Chris Angelico wrote:

> This is what different actions are for. I'd probably use
> action="store_true" here; that should mean that args.register will be
> set to True if "-r" was passed, or False if it wasn't.

Yes, otherwise it expects another argument following -r
containing a value.

-- 
Greg


More information about the Python-list mailing list