I have a program with ~20 configs, which I would like to be accessed from the command-line via argparse
, either by something like --config_1 'This is the first config'
or --config-location <path_to_config_file>
, where the path to the config file would be a .txt
of form:
--config_1 'This is the first config'
--config_2 '2nd Config'
--config_3 3
...
Currently, my code looks something like:
parser = argparse.ArgumentParser()
parser.add_argument('--config_1')
args = vars(parser.parse_args())
This approach was inspired by youtube-dl
's --config-location
. If there's a better way to accomplish what I'm trying to do, suggestions are also appreciated and welcome. Thank you for reading!