【发布时间】:2015-02-20 05:50:36
【问题描述】:
我想打印根目录中的 2 级子目录中的文件。在 shell 中我可以使用下面的 find 命令
find -mindepth 3 -type f
./one/sub1/sub2/a.txt
./one/sub1/sub2/c.txt
./one/sub1/sub2/b.txt
在 python 中我怎么能做到这一点。我知道 os.walk、glob 和 fnmatch 的基本语法。但不知道如何指定限制(如 bash 中的 mindepeth 和 maxdepth)
【问题讨论】: