gpt4 book ai didi

Python。 IOError : [Errno 13] Permission denied: when i'm copying file

转载 作者:IT老高 更新时间:2023-10-28 22:23:52 26 4
gpt4 key购买 nike

我有两个文件夹:In,Out - 它不是磁盘 D 上的系统文件夹: - Windows 7。Out 包含“myfile.txt” 我在 python 中运行以下命令:

>>> shutil.copyfile( r"d:\Out\myfile.txt", r"D:\In" )

Traceback (most recent call last):
File "<pyshell#39>", line 1, in <module>
shutil.copyfile( r"d:\Out\myfile.txt", r"D:\In" )
File "C:\Python27\lib\shutil.py", line 82, in copyfile
with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: 'D:\\In'

有什么问题?

最佳答案

阅读 docs :

shutil.copyfile(src, dst)

Copy the contents (no metadata) of the file named src to a file named dst. dst must be the complete target file name; look at copy() for a copy that accepts a target directory path.

关于Python。 IOError : [Errno 13] Permission denied: when i'm copying file,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7518067/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com