I have insane big directory. I need to get filelist via python.
In code i need to get iterator, not list. So this not work:
os.listdir
glob.glob (uses l
You should use generator. This problem is discussed here: http://bugs.python.org/issue11406
for python 2.X
import scandir
scandir.walk()
for python 3.5+
os.scandir()
https://www.python.org/dev/peps/pep-0471/
https://pypi.python.org/pypi/scandir
I found this library useful: https://github.com/benhoyt/scandir.