现有的excel文档中新增内容:https://www.jianshu.com/p/8a2fecb32e3d
现有的ppt文件中新增内容:https://www.jianshu.com/p/531af9ee77dc
现有的word文件转化成pdf:https://www.jianshu.com/p/b4c33b7044d0
1.安装插件
pip install docx
pip install python-docx
2.具体方法:
import docx
import random
def updateDocx(self):
docxPath = 'C:\\Users\\17546\\Desktop\\1.docx'
doc = docx.Document(docxPath)
doc.add_paragraph(random.choice('abcdefghijklmnopqrstuvwxyz!@#$%^&*()'))
doc.save(docxPath)
网友评论