You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
import docx
|
|
|
|
|
|
class SplitDocxUtil:
|
|
@staticmethod
|
|
def read_docx(file_path):
|
|
"""读取docx文件内容"""
|
|
try:
|
|
doc = docx.Document(file_path)
|
|
return "\n".join([para.text for para in doc.paragraphs if para.text])
|
|
except Exception as e:
|
|
print(f"读取docx文件出错: {str(e)}")
|
|
return "" |