python ディレクトリ内のすべてのファイルを取得

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python ディレクトリ内のすべてのファイルを取得相关的知识,希望对你有一定的参考价值。

def get_files(indir):
    file_list = []
    for (root, dirs, files) in os.walk(indir, followlinks=True):
        for file in files:
            file_list.append(os.path.join(root, file))
    return file_list

以上是关于python ディレクトリ内のすべてのファイルを取得的主要内容,如果未能解决你的问题,请参考以下文章