python操作excel

一.安装模块

pip install xlwt

二.往excel写数据

#创建excel

excel=xlwt.Workbook()

#添加一个sheet页

sheet=excel.add_sheet('胖妞儿')

#往行和列写入内容

sheet.write(0,0,'姓名')

sheet.write(0,1,'性别')

excel.save('students.xls')

原文地址:https://www.cnblogs.com/pangniu1234/p/10844498.html