Skip to content

Instantly share code, notes, and snippets.

@elena-roff
Last active March 20, 2019 19:41
Show Gist options
  • Save elena-roff/5884b0010d5383f884591c84fea2c7c0 to your computer and use it in GitHub Desktop.
Save elena-roff/5884b0010d5383f884591c84fea2c7c0 to your computer and use it in GitHub Desktop.
Find files recursively
import globt
# if you need a list, just use glob.glob instead of glob.iglob
for filename in glob.iglob('src/**/*.c', recursive=True):
pprint(filename)
# ----- OR -----
from pathlib import Path
# generic path
p = Path(path).expanduser()
data_path = p.glob('**/<name>-*')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment