收藏(0)运行代码:import csvimport xlwtworkbook = xlwt.Workbook()sheet2 = workbook.add_sheet("Sheet 2", cell_overwrite_ok=True)file = open(r'D:\label.csv')lines = csv.reader(file)r = 0for line in lines: col = 0 for c in line: sheet2.row(r).write(col,c, style=xlwt.Style.default_style) #print(c,end=' ') col += 1 r += 1 sheet2.flush_row_data() file.close() workbook.save("csv2excel.xlsx")
- 1 回答
- 0 关注
- 8293 浏览
添加回答
举报
0/150
提交
取消