Create an excel file in Python

import xlwt,os
from pathlib import Path
font0 = xlwt.Font() # Create the Font
font0.name = 'Times New Roman'
font0.bold = True
font0.height = 18*20
font0.colour_index = xlwt.Style.colour_map['red']
style_header = xlwt.XFStyle() # Create the Style
style_header.font = font0 # Apply the Font to the Style
font_normal=font0
font_normal.height = 12*20
font_normal.colour_index = xlwt.Style.colour_map['black']
font_normal.bold = False
style_normal=xlwt.XFStyle()
style_normal.font = font_normal
font_normal_bold = font_normal
font_normal_bold.bold = True
style_normal_bold = xlwt.XFStyle()
style_normal_bold.font = font_normal_bold
book = xlwt.Workbook()
sh = book.add_sheet("Credit Card dues", cell_overwrite_ok=True)
sh.write(RowPos, 0, "Total", style_header)
sh.write(RowPos, 1, xlwt.Formula("SUM(" + AddStartPos + ":" + EndPos + ")"), style_header)
book.save(excelfilename)