0
Ich suche nach einer Möglichkeit, einen Bericht zu formatieren, der mit Python generiert wird. Ich habe bereits Python docx library text align überprüft, aber das hat nicht funktioniert und nicht wirklich meine Bedürfnisse erfüllt.Ausrichten von Text/Formatieren von Text - Docx - Python
Was ich hoffe ist zu tun, einen Absatz Zentrum zu formatieren, wieder links, usw.
from docx import Document
from docx.enum.section import WD_SECTION
from docx.enum.text import WD_ALIGN_PARAGRAPH
document = Document()
app_name = "Company App Here"
consultant = "Jerry"
document.add_heading (app_name + " Report",0)
document.add_paragraph("Testing performed by " + consultant) #How do I align this to the center?
document.add_page_break()
document.add_heading('Executive Summary\n',1)
document.add_paragraph('''\tThe blah blah blah text here''') #Align left and bold this paragraph
document.add_page_break()
document.save('./report.docx')
Danke,
J
es wird ein docx gemäß der Fragen Anforderung -.- –