读取xls:
xls_data = xlrd.open_workbook('D:\\delete\\aaaaaa.xls')
sheetName = xls_data.sheet_names();
print sheetName
table = xls_data.sheets()[0]
rownum = table.nrows;
colnum = table.ncols;
print rownum
i=0
while i rowValue = table.row_values(i); j = 0 while j print rowValue[j] j = j+1; print table.row_values(i) i = i+1 for i in range(0,rownum-1): for j in range(0,colnum-1): print table.cell(i,j).value 写xls: file = xlwt.Workbook(encoding='utf-8',style_compression=0) table = file.add_sheet('bbbb',cell_overwrite_ok=True) table.write(0,0,'bbbb_张博') file.save('D:\\delete\\bbbb.xls');