import xlsxwriter
out_path = 'test.xlsx'
workbook = xlsxwriter.Workbook(out_path)
worksheet = workbook.add_worksheet('sheet1')
bold_red = workbook.add_format({'bold': True, 'color': 'red'})
worksheet.write_rich_string('A1',
'这是一个',
bold_red, '测试',
',哈哈哈')
workbook.close()