小编tro*_*ies的帖子

使用python-docx在MS word中以特定字体颜色写入文本

我正在尝试使用python库python-docx在MS Word文件中编写文本.我已经在这个链接上浏览了python-docx字体颜色的文档并在我的代码中应用了相同的内容,但到目前为止还没有成功.

这是我的代码:

from docx import Document
from docx.shared import RGBColor
document = Document()
run = document.add_paragraph('some text').add_run()
font = run.font
font.color.rgb = RGBColor(0x42, 0x24, 0xE9)
p=document.add_paragraph('aaa')
document.save('demo1.docx')
Run Code Online (Sandbox Code Playgroud)

word文件'demo.docx'中的文字只是黑色.

我无法弄明白,帮助将不胜感激.

python python-docx

9
推荐指数
1
解决办法
5522
查看次数

如何使用Java从私钥导出ed25519(eddsa)公钥

我正在研究https://github.com/str4d/ed25519-java库以及 BouncyCastle 等其他一些库,但到目前为止我未能成功从私钥生成公钥。我对生成密钥对不感兴趣,因为我已经拥有私钥并且只对生成相应的公钥感兴趣。

java cryptography ed25519 eddsa

7
推荐指数
1
解决办法
4729
查看次数

标签 统计

cryptography ×1

ed25519 ×1

eddsa ×1

java ×1

python ×1

python-docx ×1