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']

相关文章:

  • 2021-11-11
  • 2021-10-05
  • 2021-05-26
  • 2022-02-16
  • 2021-07-24
  • 2021-12-08
猜你喜欢
  • 2022-12-23
  • 2022-02-08
  • 2021-08-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-02
相关资源
相似解决方案