I have some text stored in a .docx
file:
Dear xx01xx,
Thank you for coming to my birthday party. I’m glad you came. Thanks for the xx02xx present!
Your best friend,
Alan Bagel
If you want to see my token of appreciation for your coming, please go to xx03xx street.
Now when I try to read text from it:
import docx
template = docx.Document("...")
for paragraph in template.paragraphs:
print(paragraph.text)
The result is just a newline! Is the support for .docx
files so limited it can be confused by the smaller font size on the file line?
问题是,即使您创建了.docx
文件,您也忘记保存它,因此python-docx
无法读取它。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.