Skip to content

Instantly share code, notes, and snippets.

@hbasria
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hbasria/3c6a140c2e2cb1e15004 to your computer and use it in GitHub Desktop.
Save hbasria/3c6a140c2e2cb1e15004 to your computer and use it in GitHub Desktop.
#result = dict_items(response, 'Body/findResponse/result/Interface')
def dict_items(dict, path, separator='/'):
for item in path.split(separator):
if item in dict:
dict = dict[item]
if type(dict) is str and len(dict)<=0:
return None
else:
return None
return dict
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment