如:
原列表 : [[12,34],[57,86,1],[43,22,7],[1,[2,3]],6]
转化为 : [12, 34, 57, 86, 1, 43, 22, 7, 1, 2, 3, 6]
a = [[12,34],[57,86,1],[43,22,7],[1,[2,3]],6]
#把列表转为字符串
b = str(a)
#替换掉'['和']'
b = b.replace('[','')
b = b.replace(']','')
#最后转化成列表
a = list(eval(b))
print(a)
执行结果 : [12, 34, 57, 86, 1, 43, 22, 7, 1, 2, 3, 6]