Various

A collection of functions that don’t really fit with anything else.

Various.fn_patternmatch(pattern)

Grabs all files in the file system that match the pattern and returns a dictionary with {file: wildcard}. Only works if the wildcard is in the file name and not in a directory name. E.g. for a directory BirdCollection/ that contains Bird_Kakapo.txt and Bird_Kea.txt: fn_patternmatch(“BirdCollection/*.txt” = {“BirdCollection/Bird_Kakapo.txt”: “Kakao”, “BirdCollection/Bird_Kea.txt”: “Kea”}

_images/Various.fn_patternmatch.png
*Various.fn_patternmatch*
{'ExampleData/BirdCollection/Bird_Kea.txt': 'Kea', 'ExampleData/BirdCollection/Bird_Kakapo.txt': 'Kakapo'}