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
You can also do the following:
say, you have foo.py :
foo.py
import json import sys data = json.loads(sys.argv[1]) print data, type(data)
Then if you run the above as : python foo.py "[1,2,3]"
python foo.py "[1,2,3]"
Output:
[1, 2, 3]