回溯(最近一次调用):IOError:[Errno 13]权限被拒绝:'演示.docx'

2024-04-25 14:20:18 发布

您现在位置:Python中文网/ 问答频道 /正文

我是Python的初学者。 我在网上看到一个帖子,说下面四行可以制作一个新的docx文档。 我按照说明安装了pythondocx模块。我把代码放在记事本上,得到了这样的结果(见图片)。密码怎么了?还是我错过了Python中的一些东西?非常感谢!在

from docx import Document
document = Document()
document.add_paragraph('Hello,Word!')
document.save('demo.docx')

如果最后bug被消除了,那么在四行代码之后,新文件应该位于哪里?这真的让我很烦恼。谢谢你的帮助。在

^{pr2}$

enter image description here


Tags: 模块代码from文档importadd密码图片