我必须创建字体为Times New Roman、字体大小为16的内容。如何使用python脚本创建?
我的示例脚本import xlwt
workbook = xlwt.Workbook(encoding = 'ascii')
worksheet = workbook.add_sheet('My Worksheet')
font = xlwt.Font() # Create the Font
font.name = 'Times New Roman'
style = xlwt.XFStyle() # Create the Style
style.font = font # Apply the Font to the Style
worksheet.write(0, 0, label = 'Unformatted value')
worksheet.write(1, 0, label = 'Formatted value') # Apply the Style to the Cell
workbook.save('fontxl.xls')
如果觉得《python怎么改字体大小_如何使用python在excel中更改字体大小》对你有帮助,请点赞、收藏,并留下你的观点哦!