Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit dd58e87

Browse files
committed
Python python-docx
1 parent 8897e65 commit dd58e87

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

‎pytyondocx/word.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from docx import Document
2+
import re
3+
4+
doc = Document(r"D:\论文.docx")
5+
restr = '"(?:[^"])*"'
6+
7+
for p in doc.paragraphs:
8+
matchRet = re.findall(restr, p.text)
9+
for r in matchRet:
10+
p.text = p.text.replace(r, '"' + r[1:-1] + '"')
11+
doc.save(r'D:\论文_修正.docx')

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /