文章目录 1.python-docx官方文档 2.安装 3.使用 3.1 打开文档 3.2 修改文档中现有的表格 3.3 添加文档 3.3.1 添加段落 3.3.2 添加表格 3.3.3 添加图片 `最终效果如下:` 附:获取桌面路径方法 1.python-docx官方文档 https://python-docx.readthedocs.io/en/latest/index.html 2.安装 pip install python-docx 3.使用 3.1 打开文档 from docx import Document # 新建文档 document = Document() # 打开旧文档