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

后端 未结 9 1384
轮回少年
轮回少年 2021-01-03 19:44

I have two folders: In, Out - it is not system folder on disk D: - Windows 7. Out contain \"myfile.txt\" I run the following command in python:

>>>          


        
9条回答
  •  粉色の甜心
    2021-01-03 19:55

    well the questionis old, for new viewer of Python 3.6 use

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

    instead of

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

    r argument is passed for reading file not for copying

提交回复
热议问题