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])
结果:
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])
结果: