Python xlrd xlwt 读取写入Excel.

import xlrd
import xlwt #读取
xlrd.Book.encoding = "gbk"
wb = xlrd.open_workbook(filename='sfp.xlsx', ) table = wb.sheets()[3]
nrows = table.nrows for k in range(1, nrows ):
print(table1.row_values(k)) #写入 workbook = xlwt.Workbook(encoding='gbk')
sheet = workbook.add_sheet("Miss")
for i in range(0, len(row)):
sheet.write(0, i, row[i])
style = xlwt.easyxf('align: wrap on')
sheet.col(0).width = 256 * 20
sheet.col(1).width = 256 * 30
sheet.col(2).width = 256 * 30 num = 1
for item in count_list :
sheet.write(num, 0, item[0], style)
sheet.write(num, 1, item[1], style)
sheet.write(num, 2, item[2], style)
num += 1 workbook.save('xxxx.xls')
上一篇:[CSS] Collapsing Margins


下一篇:LigerUI LigerGrid getSelectedRows() 多选顺序 不是从上到下修改方法