【发布时间】:2014-06-28 01:21:31
【问题描述】:
我在解析包含图像的文档中的文本时遇到问题。
我在运行 Ubuntu 12.04.4 LTS(GNU/Linux 3.2.0-60-generic x86_64)的 Ubuntu Linux 机器上使用 Python docx 0.7.0 版
我正在使用这个逻辑:
```
document = Document(path)
# Get all paragraphs
paras = document.paragraphs
text = ""
# Push the text from the paragraph on a single string
for para in paras:
# Don't forget the line break
text += "\n" + para.text
return text.strip()
```
当有图像时,此过程失败。
是不是我做错了什么?
【问题讨论】:
-
您应在此处提供错误跟踪。 “失败”有很多含义。此外,请检查库的文档和已知问题,看看它们是否支持使用图像解析文档。
标签: python ubuntu docx python-docx