wegen/sosci2word/experiment.py
Ichthyostega 05cf32c1d1 python-docx installiert / erste Experimente
- Beispiel-Dokument generieren
- bestehendes Dokument analysieren

Aus Thesis-Fragebogen.docx folgende Bestände extrahiert (als Referenz)
- document.xml
- styles.xml
2023-05-18 04:42:36 +02:00

23 lines
459 B
Python
Executable file

#!/usr/bin/python3
from docx import Document
from docx.shared import Inches
from pprint import pprint
document = Document('Thesis-Fragebogen.docx')
for par in document.paragraphs:
print(par.text)
print("---style||" + par.style.name)
print("############")
for tab in document.tables:
print("...style||" + tab.style.name)
pprint(dir(tab.style))
# pp = par.part
# pprint(dir(pp))
# for r in par.runs:
# pprint(r.text)