I have a directory with more than 100k files in it. I need to loop through them and perform operations. I don't want to load the whole list of files in memory, instead of that, I want to traverse synchronously. What is the best way to achieve that in Python?
Edit:
This question isn't similar to my question as I don't want to load all the filenames into the memory at once.