【发布时间】:2021-07-02 08:00:05
【问题描述】:
我正在尝试将 docx 文件读入 google collab,因为我的带有 anaconda 的主计算机已经停止维护。我正在尝试使用 python-docx 模块,但据我所知,我不能只在 google collab 中 pip install python-docx
'''
import docx
def getText(filename):
doc = docx.Document(filename)
fullText = []
for para in doc.paragraphs:
fullText.append(para.text)
return '\n'.join(fullText)
docxString = getText("week_8_document1.docx")
'''
有什么想法吗?
【问题讨论】:
标签: python python-3.x google-colaboratory google-docs file-read