I am using getopt to process a command line optional argument, which should accept a list. Something like this:
foo.py --my_list=[1, 2, 3, 4,5]
But this trims everything after "[1,"
My questions are:
A) Is there a way to specify a list without converting it into a string? (using getopt)
B) If I am to convert the list into a string, how to convert this list to a string? e.g. something like mylist.split("?") to get rid of square brackets ?? is there a better way?
Thank you
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…