This article mainly explains how to replace doc and docx batch text content through python and three-party libraries.
Date: May 10, 2023
Author: Ren Congcong
python3.9 version
prerequisite preparation
Install: docx, win32
pip install 包名
Introduce:
import win32com.client as win32
import docx
actual effect
You can modify documents containing pictures, tables and other types of content in doc and docx, and modify text in batches without garbled characters.
Doc, docx document content before modification