Python 2.7 从OpenDocument文本圣经中提取希伯来文文本

Python 2.7 从OpenDocument文本圣经中提取希伯来文文本,python-2.7,odf,Python 2.7,Odf,我试图用以下代码以OpenDocument text(odt)格式从圣经中提取希伯来文: from odf import text, teletype from odf.opendocument import load textdoc = load("Heb-OT.odt") texts = textdoc.getElementsByType(text.P) alltext=teletype.extractText(texts[0]) print alltext 这不打印任何内容 我不知道怎

我试图用以下代码以OpenDocument text(odt)格式从圣经中提取希伯来文:

from odf import text, teletype
from odf.opendocument import load

textdoc = load("Heb-OT.odt")
texts = textdoc.getElementsByType(text.P)
alltext=teletype.extractText(texts[0])
print alltext
这不打印任何内容 我不知道怎么了。
文档很长(1000页),但我需要全部搜索。

我在这里找到了与电传打字机实现相对应的代码:但它对我没有帮助。这是我使用的原始文档:(由LibreOffice转换为odt)显然文本提取在newline停止。。。我仍然不知道如何改变,我用odt2txt将整个文件转换为utf-8 txt,然后我就可以用codecs.open提取字符了。。。但是如果有人能回答这个问题,我仍然对知识感兴趣。