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
Why not:
python foo.py 1,2,3,4 5,6,7,8
Much cleaner than trying to eval python and doesn't require your user to know python format.
import sys list1 = sys.argv[1].split(',') list2 = [int(c) for c in sys.argv[2].split(',')] # if you want ints