Python-docx 警告 UserWarning: style lookup by style_id is deprecated. Use style name as key instead.

如果段落的style属性不符合官方文档提供的段落样式名,则会出现该提示。
例如p = doc.add_paragraph('123', style='ListNumber'),而文档中对应的styleList Number,运行之后则会出现该警告,修改为List Number即可解决。
https://python-docx.readthedocs.io/en/latest/user/styles-understanding.html
Python-docx 警告 UserWarning: style lookup by style_id is deprecated. Use style name as key instead._第1张图片

你可能感兴趣的:(python,python,开发语言)