How to extract text from an existing docx file using python-docx

后端 未结 7 1146
不思量自难忘°
不思量自难忘° 2020-11-27 15:59

I\'m trying to use python-docx module (pip install python-docx) but it seems to be very confusing as in github repo test sample they are using

7条回答
  •  误落风尘
    2020-11-27 16:35

    you can try this also

    from docx import Document
    
    document = Document('demo.docx')
    for para in document.paragraphs:
        print(para.text)
    

提交回复
热议问题