You can do something like this.
from docx import Document from docx.enum.text import WD_ALIGN_PARAGRAPH my_image = document.add_picture('path/to/image') last_paragraph = document.paragraphs[-1] last_paragraph.alignment = WD_ALIGN_PARAGRAPH.CENTER
I know that I probably answer recently, but maybe this helps someone else.
source share