标签:port style col imp sheet save pre excel 数据
import xlrd(读) ,xlwt(写),xultils(修改数据)
写Excel
import xlwt book = xlwt.Workbook() sheet = book.add_sheet(‘sheet‘) sheet.write(0,0,‘学生姓名‘) book.save("student.xls")#wps结尾用xls,用别的会打不开
修改
from xultils import copy
book = xlrd.open_workbook(‘xxx.xls‘)
new = new_book.get_sheet(0)
sheet.write(0,0‘x‘)
new_book.save(‘xxx.xls‘)
标签:port style col imp sheet save pre excel 数据
原文地址:https://www.cnblogs.com/xxxxyanyan/p/12975820.html