1、数据为List列表时,把二维列表写入文件 -- 直接ws.append():

代码

结果

代码

结果
2、把二维列表写入excel -- 通过循环单元格写入

3、数据为字典时:[[{'name': 'John Brown1S'}, {'age': 18}, {'address': 'New York No. 1 Lake Park'}]] 数据是包含key的数组:


1、数据为List列表时,把二维列表写入文件 -- 直接ws.append():
2、把二维列表写入excel -- 通过循环单元格写入
3、数据为字典时:[[{'name': 'John Brown1S'}, {'age': 18}, {'address': 'New York No. 1 Lake Park'}]] 数据是包含key的数组: