excel默认的格式是常规,能不能把默认格式改成文本?
编写个宏
f = xlwt.Workbook(encoding='utf-8') # 创建workbook,其实是execl
sheet1 = f.add_sheet('sheet1', cell_overwrite_ok=True)
style1 = xlwt.XFStyle() # 设置单元格格式为文本
style1.num_format_str = '@'
for i in range(0, 500):
for j in range(0, 30):
sheet1.write(i, j, style=style1)