How do I copy a file in Python?copy2(src,dst) is often more useful than copyfile(src,dst) because: it allows dst to be a directory (instead of the complete target filename), in which case the basename of src is used for creating the new file; it preserves the original modification and access info (mtime and atime) in the file metadata (however, this comes with a slight overhead). Here is a ...