For anyone who's looking for a "Path" way to walk:
from pathlib import Path p=Path("some_path_you_want_to_walk") for dirName, subdirList, fileList in p.walk(): print(dirName, subdirList, fileList)
First introduced in Python 3.12