best way to get files list of big directory on python?

后端 未结 9 1294
闹比i
闹比i 2021-02-07 22:36

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         


        
9条回答
  •  说谎
    说谎 (楼主)
    2021-02-07 23:31

    You should use generator. This problem is discussed here: http://bugs.python.org/issue11406

提交回复
热议问题