"""I tested 3 solutions before. And i dont understand, how right solved it."""
def flatten(dictionary):
stack = [((), dictionary)]
result = {}
while stack:
path, current = stack.pop()
for k,v in current.items():
if isinstance(v, dict) and len(v)>=1:
stack.append((path + (k,),v))
else:
result["/".join((path + (k,)))] = str(v).replace('{}',"")
return result
Created at: 2014/11/05 09:27; Updated at: 2016/09/23 12:30