PyDocs

Nav

File and Directory Access

PurePath.suffixes

pathlib

attribute of PurePath (source)
A list of the final component's suffixes, if any.

These include the leading periods. For example: ['.tar', '.gz']
Changed in 3.14
  • 3.14: A single dot (”.”) is considered a valid suffix.
1 Example
>>> PurePosixPath('my/library.tar.gar').suffixes
['.tar', '.gar']
>>> PurePosixPath('my/library.tar.gz').suffixes
['.tar', '.gz']
>>> PurePosixPath('my/library').suffixes
[]
from the Python docs
See Also
No see-alsos for pathlib/PurePath.suffixes
0 Notes
No notes for PurePath.suffixes