e.g., to parse
./test.py --species electron proton --mass_electron 1
Here, the second argument name mass_electron
is valid because electron
is one of the values we passed to the argument species
.
Edit 1:
This is different from another question Arguments that are dependent on other arguments with Argparse since I would like the argument name to depend on the value of another argument, i.e., that value is arbitrary.