I have a script which has a default input and output csv. With argparse
, I’m adding an option to use user-defined input and output CSVs. If the inputcsv
option is used, outputcsv
option needs to be required to avoid overwriting data.
convert_parser.add_argument("-i", "--inputcsv", required=False, help="If not using default csv, filepath of input csv")
convert_parser.add_argument("-o","--outputcsv", required=False, help="If not using default csv, filepath for output csv with conversion status.")
Essentially I want the opposite of add_mutually_exclusive_group
– I need to add a mutually inclusive group. Does argparse
have a way to do this?
New contributor
emilymcgrew is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
0