Nono.MA

Copy files with shutil

MARCH 7, 2022

Here's a straightforward way to copy a file with Python to a different path or directory, also useful to duplicate or version a file with a different name.

import shutil

from = '/path/to/origin/file.md'
to = '/path/to/destination/new-name.md'

shutil.copy(from, to)

Source

BlogCodePython