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])
python将字符串转换成列表
最新推荐文章于 2023-11-13 15:00:00 发布
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])