Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

argparse accept only few options

...
parser.add_argument('--val',
                    choices=['a', 'b', 'c'],
                    help='Special testing value')

args = parser.parse_args(sys.argv[1:])
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #argparse #accept #options
ADD COMMENT
Topic
Name
8+8 =