Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

argparse mutually exclusive

import argparse

parser = argparse.ArgumentParser()

group = parser.add_mutually_exclusive_group()
group.add_argument('-a', action='store_true')
group.add_argument('-b', action='store_true')

print parser.parse_args()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #argparse #mutually #exclusive
ADD COMMENT
Topic
Name
3+3 =