python将二维数组转换为excel保存

from multiprocessing import Process
import xlrd
import xlwt  #对xls文件进行改写
from xlutils.copy import copy
#二维数组转excel储存
def transformation(ls2):
        #ls2为二维数组
        workbook = xlwt.Workbook()
        sheet = workbook.add_sheet("Sheet")

        for i in range(len(ls2)):
                for j in range(len(ls2[i])):
                        sheet.write(i, j, ls2[i][j])

        workbook.save("list2Excel.xls")

        
                        
                            
if __name__ == '__main__':
        count(ls2)
       

你可能感兴趣的:(python,excel,开发语言)