import xlwt
sheet_name = 'sheet_name'
excel_name = 'excel_name.xls'
#创建表,第一次循环(编码模式),第二次循环(qp)
f = xlwt.Workbook()
sheet = f.add_sheet(sheet_name , cell_overwrite_ok=True)
row_index = 0
col_index = 0
content = 'content'
sheet.write(row_index , col_index , content )
f.save(excel_name )