I am trying to pass from the command line a delimited string of numbers including negative numbers using argparse.
ap = argparse.ArgumentParser()
ap.add_argument("-l","--list",help="delimited string input",type=str)
args = vars(ap.parse_args())
When I run the code using:
python3 prog.py -l "-1,0,1,0,1,0,1,0,-1"
I get:
usage: camWithFilterDemo.py [-h] [-l LIST]
camWithFilterDemo.py: error: argument -l/--list: expected one argument
Can anyone help with a solution or other options I should look into or consider.