1.得到如图中表格数据,要求得到图二效果
图一
图二
import xlwt, openpyxl
# 标题填充颜色43
hw = openpyxl.open("fifles/homework.xlsx")
student_sheet = hw.active
finish = xlwt.Workbook()
# 创建全体字体对象
font_all = xlwt.Font()
font_all.name = '宋体'
font_all.height = 18 * 18
# 创建标题字体
font_title = xlwt.Font()
font_title.name = '宋体'
font_title.height = 24 * 24
font_title.bold = True
# 创建姓名字体对象
font_name = xlwt.Font()
font_name.name = '宋体'
font_name.height = 18 * 18
font_name.colour_index = 46
# 创建不及格字体对象
font_bjg = xlwt.Font()
font_all.name = '黑体'
font_all.height = 18