首页 > 解决方案 > 使用 openpyxl 为现有文件中的某些文本行着色

问题描述

我想知道是否可以使用 openpyxl 仅对一些文本/字符行着色并将它们输出到同一个 Excel 表上?

例子:

The dog is red. The man is blue. My favorite color is black.

至:

The dog is [blue] red [/blue]. The man is [blue] blue [/blue] . My favorite color is [blue] yellow [/blue].

我有需要颜色的字符串和字符串的位置,即使它是相同的颜色(蓝色或绿色)也可以。

谢谢!

注:[blue] [/blue]表示括号内的颜色为蓝色。

标签: pythonexcelopenpyxl

解决方案


推荐阅读