Skip to content

Instantly share code, notes, and snippets.

@k0001
Created October 30, 2008 02:36
Show Gist options
  • Save k0001/20888 to your computer and use it in GitHub Desktop.
Save k0001/20888 to your computer and use it in GitHub Desktop.
In [84]: a
Out[84]:
{'b1': {'c1': {'d1': 'X1', 'd2': 'X2'}, 'c2': {'d3': 'X3', 'd4': 'X4'}},
'b2': {'c3': {'d2': 'X6', 'd5': 'X1'}, 'c4': {'d7': 'X7', 'd8': 'X8'}}}
In [85]: f(a, 'b1/c2/d4')
Out[85]: 'X4'
In [86]: f(a, 'b2/c4')
Out[86]: {'d7': 'X7', 'd8': 'X8'}
In [87]: f(a, 'b2/c4/d8')
Out[87]: 'X8'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment