PyDocs

Nav

File and Directory Access

Path.replace

pathlib

method of Path (source)
  • Path.replace(target)
Rename this path to the target path, overwriting if that path exists.

The target path may be absolute or relative. Relative paths are
interpreted relative to the current working directory, *not* the
directory of the Path object.

Returns the new Path instance pointing to the target path.
Changed in 3.8
  • 3.8: Added return value, return the new Path instance.
0 Examples
No examples for pathlib/Path.replace.
See Also
No see-alsos for pathlib/Path.replace
0 Notes
No notes for Path.replace