Answers for "python argparse only allow certain values"

0

python argparse only allow certain values

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

args = parser.parse_args(sys.argv[1:])
Posted by: Guest on March-22-2021

Code answers related to "python argparse only allow certain values"

Python Answers by Framework

Browse Popular Code Answers by Language