Argparse"ArgumentError: argument -h/--help: conflicting option string(s): -h, --help"
argparse
adds --help
and -h
options by default. If you don't want to use the built-in help feature, you need to disable it with:
parser = argparse.ArgumentParser(add_help=False)
See the documentation
The same error pop-ups in 2 other scenarios:
1) Repeated code
parser.add_argument('-h',
'--help',
action='store_true',
help=argparse.SUPPRESS)
parser.add_argument('-h',
'--help',
action='store_true',
help=argparse.SUPPRESS)
2) When you execute the code multiple times on the same kernel
I'm leaving it just in case if someone had simillar problem.