Path.glob(pattern)
Glob the given pattern in the directory represented by this path, yielding all matching files (of any kind):
>>> sorted(Path('.').glob('*.py'))
[PosixPath('pathlib.py'), PosixPath('setup.py'), PosixPath('test_pathlib.py')]
>>> sorted(Path('.').glob('*/*.py'))
[PosixPath('docs/conf.py')]
The “**” pattern means “this directory and all subdirectories, recursively”. In other words, it enables recursive globbing:
>>> sorted(Path('.').glob('**/*.py'))