ID EN
Pathlib

rglob

Python 3.11

This is like calling Path.glob() with “**/” added in front of the given relative pattern:

Syntax

PYTHON
Path.rglob(pattern)

Examples

Example 1
PYTHON
>>> sorted(Path().rglob("*.py"))
[PosixPath('build/lib/pathlib.py'),
 PosixPath('docs/conf.py'),
 PosixPath('pathlib.py'),
 PosixPath('setup.py'),
 PosixPath('test_pathlib.py')]

See Also

Path.glob() auditing event sep altsep