« * K @lernerpython.com

Reuven M. Lerner @lernerpython.com

2026-12-03 16:30 UTC

#Python pathlib's "glob" returns files (path objects) matching a pattern in a directory. Use "rglob" to find matches recursively, in subdirectories: from pathlib import Path p = Path('/etc/') print(len(list(p.glob('*.conf')))) # 17 print(len(list(p.rglob('*.conf')))) # 63

1 picture (not shown on this phone)

2 likes, 0 reposts, 0 replies

3 Next post4 More from @lernerpython.comBackBluesky home
☆ Save to home · 0 Home · Find · Games · Chat · AI · Setup