将下面python3代码Excel中M列表头背景色单独设置为紫色字体加粗import osimport reimport subprocessimport openpyxlimport mathfrom openpyxlstyles import Font PatternFill Alignment# 视频格式supported_formats = mp4 avi mkv
将下面代码加入到headers循环中,即可单独设置M列表头背景色为紫色,字体加粗:
if header == '压缩比率': cell = ws.cell(row=1, column=col, value=header) cell.font = header_font cell.fill = header_fill cell.alignment = header_alignment purple_fill = PatternFill('solid', fgColor='800080') cell.fill = purple_fill
原文地址: http://www.cveoy.top/t/topic/beK0 著作权归作者所有。请勿转载和采集!