How do I limit os.walk to only return files in the directory I provide it?
os.walk
def _dir_list(self, dir_name, whitelist): outputList = [] for
You could use os.listdir() which returns a list of names (for both files and directories) in a given directory. If you need to distinguish between files and directories, call os.stat() on each name.
os.stat()