📜  python代码示例中的过滤目录

📅  最后修改于: 2022-03-11 14:46:58.693000             🧑  作者: Mango

代码示例1
#import fnmatch and os
import os, fnmatch

#path to use
path = "/kite/run"

#filter for all the python files
files = fnmatch.filter(os.listdir(path), "*.py")

#display the python files
print(files)