python - 使用 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]
表示括号内的颜色为蓝色。
解决方案
推荐阅读
- python - 带有 lambda 函数转换的 Python 列表推导
- tensorflow - 使用 TensorFlow 和 Keras 防止迁移学习中的过拟合
- javascript - 在 const 中赋值
- node.js - 异步/等待中的递归无法在主函数中解析
- java - 为什么Httpclient只能得到202,而浏览器可以取回图像内容
- python-3.x - 如何将 dict of ... dict 的 dict 列表解析为数据帧?
- c++ - 如何在 OMNet++ 中访问我的模拟的不同节点?
- node.js - 为什么 Red Hat OpenShift 不克隆该项目?
- rust - 如何将指向可变变量的指针共享给线程?
- html - 具有不同颜色扇区的 div/图像周围的圆形边框