shutil.copyfile: PermissionError: [Errno 13] Permission denied

shutil. copyfile ( src, dst, *, follow_symlinks=True )

Copy the contents (no metadata) of the file named src to a file nameddst and return dst. src and dst are path names given as strings.dst must be the complete target file name; look at shutil.copy()for a copy that accepts a target directory path. If src and dstspecify the same file, SameFileError is raised.

犯了一个想当然的错误,本以为 src是已存在的文件,而copyfile的功能是将 src 整个文件复制并重命名为 dst ,emmm事实上 src 与 dst  两个都是已存在的文件,copyfile的功能是将src中的数据拷贝到dst文件中。

PS:我最开始就是进的官方文档找答案,我按照自己的翻译理解了他的用法……然鹅……  原来我的英语水平这么垃圾,啊,暴击  还是抱谷歌翻译大腿吧……

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值