ID EN
Pathlib

replace

Python 3.11

Rename this file or directory to the given target, and return a new Path instance pointing to target. If target points to an existing file or empty directory, it will be unconditionally replaced.

Syntax

PYTHON
Path.replace(target)