from pathlib import Path for path in Path('src').rglob('*.py'): if path.stat().st_size > 50_000: print(path, path.stat().st_size)