PyDocs

Nav

File and Directory Access

copy

shutil

function (source)
  • copy(src, dst, *, follow_symlinks=True)
Copy data and mode bits ("cp src dst"). Return the file's destination.

The destination may be a directory.

If follow_symlinks is false, symlinks won't be followed. This
resembles GNU's "cp -P src dst".

If source and destination are the same file, a SameFileError will be
raised.
Changed in 3.3, 3.8
  • 3.3: Added follow_symlinks argument. Now returns path to the newly created file.
  • 3.8: Platform-specific fast-copy syscalls may be used internally in order to copy the file more efficiently. See Platform-dependent efficient copy operations section.
0 Examples
No examples for shutil/copy.
See Also
No see-alsos for shutil/copy
0 Notes
No notes for copy