PurePath.with_suffix(suffix)
Return a new path with the suffix
changed. If the original path doesn’t have a suffix, the new suffix is appended instead:
1 2 3 4 5 6 | >>> p = PureWindowsPath( 'c:/Downloads/pathlib.tar.gz' ) >>> p.with_suffix( '.bz2' ) PureWindowsPath( 'c:/Downloads/pathlib.tar.bz2' ) >>> p = PureWindowsPath( 'README' ) >>> p.with_suffix( '.txt' ) PureWindowsPath( 'README.txt' ) |
Please login to continue.