Python 错误13权限被拒绝
我试图编写一个代码来比较目录(子目录和其中的文件),然后将其他目录的内容(文件仅包括子目录中的文件)复制到其他目录。我导入了所有内容,然后我有了这个:Python 错误13权限被拒绝,python,compiler-errors,python-2.4,Python,Compiler Errors,Python 2.4,我试图编写一个代码来比较目录(子目录和其中的文件),然后将其他目录的内容(文件仅包括子目录中的文件)复制到其他目录。我导入了所有内容,然后我有了这个: dst = "C:/somefolder" path = "C:/otherplace" compare = filecmp.dircmp(path,dst) ans = compare.right_only for fil in ans: if len(ans)>0: shutil.copy2(dst,path) 我尝试
dst = "C:/somefolder"
path = "C:/otherplace"
compare = filecmp.dircmp(path,dst)
ans = compare.right_only
for fil in ans:
if len(ans)>0:
shutil.copy2(dst,path)
我尝试过使用os.listdir的其他路由,但我似乎总是以错误告终
IOError:[Errno 13]权限被拒绝
这是用python 24编写的
我正在使用cygwin运行代码,但我是windows用户您无权在该位置编写代码。若要验证,请转到该路径并尝试创建新文件夹。你能创建一个吗?我可以创建新文件夹,我是管理员。如果你在windows计算机上,请尝试以管理员身份运行脚本<代码>以管理员身份运行我不知道该怎么做。右键单击cmd.exe并点击“以管理员身份运行”