- Beispiel-Dokument generieren - bestehendes Dokument analysieren Aus Thesis-Fragebogen.docx folgende Bestände extrahiert (als Referenz) - document.xml - styles.xml
23 lines
459 B
Python
Executable file
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)
|
|
|
|
|
|
|