Skip to content

Instantly share code, notes, and snippets.

@jbpotonnier
Created June 15, 2012 19:22
Show Gist options
  • Save jbpotonnier/2938302 to your computer and use it in GitHub Desktop.
Save jbpotonnier/2938302 to your computer and use it in GitHub Desktop.
Find recursively by key
def find(d, key):
if key in d:
yield d[key]
for c in d.get('children', []):
for e in find(c, key): yield e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment