python-docx操作

import docx
# 读取docx文档内容
def readWord():
    doc = docx.Document('demo.docx')
    fullText = []
    for para in doc.paragraphs:
        fullText.append(' ' + para.text)
    print('\n' . join(fullText))
 
posted @ 2018-09-14 11:38  黒貓  阅读(763)  评论(0编辑  收藏  举报