修改结构

This commit is contained in:
雷雨
2025-12-05 11:43:37 +08:00
parent 351df35642
commit dcc6db2363
2 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
from docx import Document
def extract_tables_from_docx(file_path):
doc = Document(file_path)
tables = []
for table in doc.tables:
rows = []
for row in table.rows:
cells = [cell.text for cell in row.cells]
rows.append(cells)
tables.append(rows)
return tables