python shutil.copy()[Errno 13]权限被拒绝

时间:2018-11-28 20:23:29

标签: python-3.x shutil

我想像这样简单地复制文件:

>>> import shutil
>>> shutil.copy("C:/Users/xyz/Desktop/a","C:/Users/xyz/Desktop/b/a")

但这是一个错误:

Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    shutil.copy("C:/Users/xyz/Desktop/a","C:/Users/xyz/Desktop/b/a")
  File "C:\Users\xyz\AppData\Local\Programs\Python\Python37-32\lib\shutil.py", line 241, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "C:\Users\xyz\AppData\Local\Programs\Python\Python37-32\lib\shutil.py", line 120, in copyfile
    with open(src, 'rb') as fsrc:
PermissionError: [Errno 13] Permission denied: 'C:/Users/xyz/Desktop/a'

请帮忙...

`

0 个答案:

没有答案