python將字符串轉換成列表

import re s = "[[sd,httf,g],[sd,httf,g]]" s = eval(re.sub("(?P<value>\w+)",lambda x:repr(x.group("value")),s)) print(s[0]) 輸出結果:
相關文章
相關標籤/搜索