import docx
file=docx.Document(r'C:\Users\86182\Desktop\010.docx')
L = str(len(file.paragraphs))
print (L)
计算出每一段落的长度
for i in range(52):
print(file.paragraphs[i].text)
s=str(file.paragraphs[i].text)
j=0
for m in s [-1::-1]:
if m !=' ':
j=j+1
else :
break
print (j)
利用段落从最后进行进行匹配