Skip to content

Instantly share code, notes, and snippets.

@zh3389
Created July 8, 2021 06:10
Show Gist options
  • Save zh3389/bf0aadea22d6626d2126cb6bf584ed4e to your computer and use it in GitHub Desktop.
Save zh3389/bf0aadea22d6626d2126cb6bf584ed4e to your computer and use it in GitHub Desktop.
import fnmatch, os
def find(pattern, path):
result = []
for root, dirs, files in os.walk(path):
for name in files:
if fnmatch.fnmatch(name, pattern):
result.append(os.path.join(root, name))
return result
root_path = "/Users/seven/_seven/Fingerprint_Website/datasets"
images_path = find("*.json", root_path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment