import xlrd
from xlutils import copy

# 先用xlrd模块,打开一个excel
book=xlrd.open_workbook('app_student.xls')

# 通过xlutils这个模块里面的copy方法,复制一份excek
new_book=copy.copy(book)

sheet=new_book.get_sheet(0) #获取sheet
# sheet.write(0,0,'编号')
# sheet.write(0,1,'名字')

lis = ['编号','名字','性别','年龄','地址','班级','手机号','金币']

for col, filed in enumerate(lis):
sheet.write(0, col, filed)
new_book.save('app_student.xls')

相关文章:

  • 2021-10-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2021-08-11
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-18
  • 2021-12-04
  • 2021-11-27
相关资源
相似解决方案