- 博客(2)
- 收藏
- 关注
原创 python中使用add_paragraph后,出现手动换行符
当我用下面操作时,会出现添加的每一行后面都有手动换行符 from docx import Document # 打开题目.txt文件 f = open('题目.txt', encoding='utf-8') document = Document() # 读取文件内容 for i in f: document.add_paragraph(text=i) # 关闭文件 f.close() document.save('题目.docx') 然后我就加了 i=i.strip() from .
2022-11-11 10:58:30
613
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人