7-3 python操作excel

1、写excel

  写入特定单元格数据

# 1、导入xlwt模块
# 2、新建一个excel
# 3、添加一个sheet页
# 4、往指定的单元格中写入数据
# 5、保存excel

import xlwt
book = xlwt.Workbook()
sheet = book.add_sheet('sheet1')
sheet.write(0,0,'编号')  # (行,列,写入的数据)
book.save('a.xls')

  

原文地址:https://www.cnblogs.com/hushaoyan/p/10183308.html