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:
>>>
Use shutil.copy2 instead of shutil.copyfile
import shutil shutil.copy2('/src/dir/file.ext','/dst/dir/newname.ext') # file copy to another file shutil.copy2('/src/file.ext', '/dst/dir') # file copy to diff directory