ID EN
Shutil

copy

Python 3.11

Copies the file src to the file or directory dst. src and dst should be path-like objects or strings. If dst specifies a directory, the file will be copied into dst using the base filename from src. If dst specifies a file that already exists, it will be replaced. Returns the path to the newly created file.

Syntax

PYTHON
shutil.copy(src, dst, *, follow_symlinks=True)

See Also

path-like objects copy() os.chmod() copy2() auditing event auditing event Platform-dependent efficient copy operations