标签:
http://stackoverflow.com/questions/1894269/convert-string-representation-of-list-to-list-in-python
>>> import ast
>>> x = u‘[ "A","B","C" , " D"]‘
>>> x = ast.literal_eval(x)
>>> x
[‘A‘, ‘B‘, ‘C‘, ‘ D‘]
>>> x = [n.strip() for n in x]
>>> x
[‘A‘, ‘B‘, ‘C‘, ‘D‘]
Python convert list string to list
标签:
原文地址:http://www.cnblogs.com/yaoshi/p/5153953.html