I'm using the python optparse module in my program, and I'm having trouble finding an easy way to parse an option that contains a list of values.
For example:
--groups one,two,three.
I'd like to be able to access these values in a list format as options.groups[]
. Is there an optparse option to convert comma separated values into a list? Or do I have to do this manually?
question from:
https://stackoverflow.com/questions/392041/python-optparse-list 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…