from pathlib import Path path = Path(__file__).parent.glob("**/*.yaml") for i in path: print(type(i))