Answers for "filter directory in python"

0

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)
Posted by: Guest on September-29-2020

Python Answers by Framework

Browse Popular Code Answers by Language