输出为excel文本格式操作,该代码已测试,可直接输出,不懂可问。
import xlwt
from datetime import datetime
style0 = xlwt.easyxf('font: name Times New Roman, color-index blue, bold on',num_format_str='#,##0.00')
style1 = xlwt.easyxf(num_format_str='D-MMM-YY')
wb = xlwt.Workbook()
ws = wb.add_sheet('liao qing jian')
ws.write(0, 0,"liaoqingjian", style0)
ws.write(1, 0, datetime.now(), style1)
ws.write(3,0,"廖庆健")
wb.save('jian.xls')