设置图片的对齐方式

from   docx.enum.text   import  WD_PARAGRAPH_ALIGNMENT
from  docx  import  Document

w=Document(r'文件路径')
picture=w.paragraphs[1].add_run().add_picture(r'')
w.paragraphs[1].alignment=WD_PARAGRAPH_ALIGNMENT.CENTER  #中间对齐
w.save(r'')


#对齐方式
LEFT,RIGHT,CENTER,JUSTIFY(两端对齐),DISTRIBUTE(分散对齐)
原文地址:https://www.cnblogs.com/luckiness/p/13229249.html