myimagelib.myImageLib.dirrec

myimagelib.myImageLib.dirrec(path, filename)

Recursively look for all the directories of files with name filename.

Parameters:
  • path (str) – the directory where you want to look for files.

  • filename (str) – name of the files you want to look for.

Returns:

a list of full directories of files with name filename

Return type:

list[str]

Note

filename can be partially specified, e.g. *.py to search for all the files that end with .py. Similarly, setting filename as *track* will search for all files starting with track.

Note

It is generally recommended to use readdata() instead of dirrec() if you are looking for files with a specific extension.

>>> from myimagelib import dirrec
>>> dirrec("path/to/folder", filename="*.csv")

Edit

  • Nov 15, 2022 – Fix a bug, which falsely uses dirrec() within itself to iterate over subdirectories.