当前位置:网站首页>Openpyxl library fill color
Openpyxl library fill color
2022-07-29 01:28:00 【Struggling migrant workers】
List of articles
Code
import openpyxl
from openpyxl.styles import PatternFill
# Import fill class PatternFill
wb = openpyxl.load_workbook('/Users/test0712.xlsx')
ws = wb['Sheet1']
max_rows = ws.max_row # Get the largest row
max_columns = ws.max_column # Get the largest column
fills = PatternFill("solid", fgColor="FFC0CB") # Set the fill color to pink
# openpyxl Subscript from 1 Start
for i in range(1, max_rows + 1):
for j in range(1, max_columns + 1):
ws.cell(i, j).fill = fills
wb.save('/Users/test0712.xlsx')
Before filling :

After filling

边栏推荐
猜你喜欢

C language 300 lines of code to achieve mine sweeping (deployable + markable + changeable difficulty level)

什么是原码、反码和补码

Flink Postgres CDC

Three ways of creating indexes in MySQL

ACM SIGIR 2022 | interpretation of selected papers of meituan technical team

Learning summary of time complexity and space complexity

Flask project architecture (First Edition

Oozie job scheduling

20220728-不纯为数字的字符串排序
![A ten thousand word blog post takes you into the pit. Reptiles are a dead end [ten thousand word pictures]](/img/aa/a5e7b4516aa395f8d4d0e2eee7d3c7.png)
A ten thousand word blog post takes you into the pit. Reptiles are a dead end [ten thousand word pictures]
随机推荐
Flash reports an error: type object 'news' has no attribute' query 'the view name is duplicate with the model name
PlatoFarm社区生态福音,用户可借助Elephant Swap获得溢价收益
PLATO上线LAAS协议Elephant Swap,用户可借此获得溢价收益
PLATO上线LAAS协议Elephant Swap,用户可借此获得溢价收益
SDRAM Controller Design (two design methods of digital controller)
[MySQL] historical cumulative de duplication of multiple indicators
Brushless DC motor controller (how much is the hall charge for changing the motor)
跨模态对齐 20220728
了解网址url的组成后 运用url模块、querystring模块和mime模块完善静态网站
RHCE命令练习(二)
Flask project architecture (First Edition
uniapp createSelectorQuery(). Select get returns null error
SQL question brushing: find the employee number EMP with more than 15 salary records_ No and its corresponding recording times t
图扑软件亮相 2022 福州数博会,携手共创数字新时代
Subtotal of process thread coordination
20220728 sorting strings that are not pure numbers
梅克尔工作室——HarmonyOS实现列表待办
vm options、program arguments、environment property
How to deal with the time, scope and cost constraints in the project?
[idea] where to use the query field