python - 如何使用 python pptx 从 powerpoint 中提取特定文本?
问题描述
我正在使用 ue4 & python pptx,我正在尝试将我的文本类型分成数组。我的标题文本在他们自己的数组中,我的图像也在他们的数组中。但是,我希望将所有其他不是标题的文本放入其自己的数组中,但在尝试仅提取特定文本时会傻眼。我目前有这个提取所有文本:
for slide in prs.slides:
titlePlaceholder = slide.shapes.title.text
titleArray.append(titlePlaceholder)
for shape in slide.shapes:
if not shape.has_text_frame:
continue
for paragraph in shape.text_frame.paragraphs:
for run in paragraph.runs:
paraArray.append(run.text)
解决方案
推荐阅读
- javascript - SVG + javascript单击并拖动缓慢
- python - Sympy 和 Numpy 无法对使用 Sympy 创建的矩阵求逆
- php - 错误:一般错误:Laravel 中的 1364 字段
- assembly - MIPS中使用addi vs addiu的具体情况
- javascript - 将包含其他数组的数组调用到函数中,而无需调用每个单独的数组
- css - SCSS:为什么父子选择器语法不应用样式?
- databricks - MLFlow 模型未登录到 Azure Blob 存储
- sbt - 如何为 sbt artefacts 指定权限
- ios - 如何知道 Swift (iOS) 中第一个 sim 卡或第二个 sim 卡的数据是否开启
- azure - 数据工厂中使用的 Python Azure 函数返回:“响应内容不是有效的 JObject”