python遍历目录的方法 walk listdir 这篇文章里描述了这些情况: https://www.cnblogs.com/jiaxin359/p/7324077.html 不用递归的时候,用 listdir 需要递归的时候,用walk