import xlwtbook=xlwt.Workbook() #新建一个excelsheet=book.add_sheet(‘sheet1‘) #加sheet页sheet.write(0,0,‘姓名‘)sheet.write(0,1,‘年龄‘)sheet.write(0,2,‘性别‘)book.save(‘stu.xls‘) #结尾一定要用.xls
写excel
原文:https://www.cnblogs.com/jiadan/p/8989779.html