I've noticed that Path().rglob()
hangs my script after processing if I pass a large directory (or drive in my case). Is there a way to mitigate that?
from pathlib import Path
for p in Path('C:\\').rglob('Downloads'):
print(str(p))
The above hangs my script for a few seconds after the search completes and before it prints the results. Anyone have an idea why? Can I eliminate that? If I search a smaller directory, it does not hang.