# -*- coding: utf-8 -*- import zipfile, re, json, sys, io sys.stdout.reconfigure(encoding="utf-8") p = r"C:\Users\aroun\Desktop\在线考试系统\在线考试系统技术文案(方案B).docx" z = zipfile.ZipFile(p) xml = z.read("word/document.xml").decode("utf-8") paras = re.findall(r"].*?", xml, re.S) out = [] for pa in paras: texts = re.findall(r"]*>(.*?)", pa, re.S) t = "".join(texts) t = t.replace("&", "&").replace("<", "<").replace(">", ">").replace(""", '"') m = re.search(r'