I was trying to pass two lists containing integers as arguments to a python code. But sys.argv[i] gets the parameters as a list of string.
sys.argv[i]
Input would
I tested this on my end, and my input looks like this:
python foo.py "[1,2,3,4]" "[5,6,7,8,9]"
I'm doing the following to convert the two params of interest:
import ast import sys list1 = ast.literal_eval(sys.argv[1]) list2 = ast.literal_eval(sys.argv[2])