Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

filter directory in python

#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)
 
PREVIOUS NEXT
Tagged: #filter #directory #python
ADD COMMENT
Topic
Name
3+4 =