I have a code that takes the command-line arguments into a parser and modifies some configuration settings. Something like this:
command:
python mycode.py --config-file "some_file.yaml" SOMETHING.subsetting_a 2 SOMETHING.subsetting_b 3
and then it does:
import argparse
parser = argparse.ArgumentParser(description="Some description here")
parser.add_argument(
"--config-file",
default="",
metavar="FILE",
help="path to config file",
type=str,
)
//some more 'add_argument' lines here
args = parser.parse_args()
But as I am using jupyter notebook, it would be easier to provide the arguments directly to the parser, as if they come from the command-line. How can I create a string containing the command (as mentioned above) and pass it to parser?
args = argparse.Namespace(config_file='some_file.yaml', ...)(skipping theparse_argsstep).