上传者: 38604395 
                                    |
                                    上传时间: 2022-07-07 14:30:51
                                    |
                                    文件大小: 35KB
                                    |
                                    文件类型: PDF
                                
                            
                                
                            
                                读取docx文档
使用的包是python-docx
1. 安装python-docx包
sudo pip install python-docx 
2. 使用python-docx包读取数据
#encoding:utf8
import docx
doc = docx.Document('test.docx')
docText = '\n'.join([paragraph.text for paragraph in doc.paragraphs])
#print(docText) 
python-docx这个包是不能处理doc文档的,要读取doc文档内容的话需要使用antiword这个工具。