我有两个文件夹:输入,输出-它不是磁盘D上的系统文件夹:-Windows 7。Out contain“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:
我解决了这个问题,你应该是目的地的完整目标文件名
目的地=路径目录+文件名。*
我在shuil中使用此代码fir copy wav文件:
使用 shutil.copy而不是shutil.copyfile
示例:
相关问题 更多 >
编程相关推荐