I want to turn a command line like this
python3 abc.py abc.csv CC
into strings abc.csv
and CC
but I'm not sure if I should use the parse_args() once or call it twice at the main(), as demonstrated below
def parse_args( arg ) :
parser = ArgumentParser()
parser.add_argument( "file", help = "path to csv file" )
return parser.parse_args( arg )
if __name__ == "__main__" :
path = parse_args( sys.argv [ : - 3 ] )
abv = parse_args( sys.argv [ - 2 : ] )
func( path, abv )
where func() take two strings. Right now it doesn't seem to be working.