python数组字符串还原为数组

1 # coding=utf-8
2 s = '[[[0,0,0],[0,0,0],[0,0,0]],[[1,1,1],[1,1,1],[1,1,1]],[[2,2,2],[2,2,2],[2,2,2]]]'
3 print(s[0])
4 x = eval(s)
5 print(x)
6 print(x[0])

结果:

 

posted on 2021-06-30 16:46  方圆几百里Idea  阅读(238)  评论(0编辑  收藏  举报

导航