写excel 安装pip install xlwt 模块
#写excel import xlwt book = xlwt.Workbook()#新建一个excel sheet = book.add_sheet('sheet1') #加sheet页 sheet.write(0,0,'姓名') # 行 列 写入的内容 sheet.write(0,1,'年龄') sheet.write(0,2,'性别') book.save('stu.xls') #结尾一定要用.xls
#写excel import xlwt book = xlwt.Workbook()#新建一个excel sheet = book.add_sheet('sheet1') #加sheet页 sheet.write(0,0,'姓名') # 行 列 写入的内容 sheet.write(0,1,'年龄') sheet.write(0,2,'性别') book.save('stu.xls') #结尾一定要用.xls
转载于:https://www.cnblogs.com/nuobao/p/9177203.html