标签:列表 推导式 font 格式 point 数据 ble itertools port
由于从站点获取到的数据格式存在 二维列表,所以提取出变成一维列表的集中方法记录:
ab = [[1,2,3], [4,5], [6,7,8]]
print([i for item in ab for i in item])
from
compiler.ast
import
flatten
a
=
[[
1
,
2
],[
3
,
4
]]
print
(flatten(a))
from itertools import chain
points = [[
1
,
2
],[
3
,
4
]]
func_chain = list(chain.from_iterable(points))
标签:列表 推导式 font 格式 point 数据 ble itertools port
原文地址:https://www.cnblogs.com/sdosun/p/13246075.html