python写excel

1、先导入import xlwt

2、步骤:新建excel:book=xlwt.Workbook()——新建页:sheet=book.add_sheet('页的名字')——新增元素:sheet.write(0,0,'姓名')——保存excel:book.save('名字.xls'),,,,在新增sheet页的时候,可以新增多个sheet页并写进元素

 

posted on 2019-05-08 11:58  金龟子大战猕猴桃  阅读(175)  评论(0编辑  收藏  举报