ID EN
Pathlib

suffix

Python 3.11

The file extension of the final component, if any:

Syntax

PYTHON
PurePath.suffix

Examples

Example 1
PYTHON
>>> PurePosixPath('my/library/setup.py').suffix
'.py'
>>> PurePosixPath('my/library.tar.gz').suffix
'.gz'
>>> PurePosixPath('my/library').suffix
''