【发布时间】:2018-10-01 08:04:37
【问题描述】:
我正在使用以下代码从 .docx 文件中提取文本
def getText(filename):
doc = docx.Document(filename)
fullText = []
for para in doc.paragraphs:
fullText.append(para.text)
return '\n'.join(fullText)
data = getText(file_path)
现在,我还想在 pythonanywhere 上托管的 django rest api 中提取 .doc 文件。由于 api 在 pythonanywhere 上,我无法安装 textract 库和 antiword。那么,我该怎么做?
【问题讨论】:
标签: python-2.7 pythonanywhere .doc