Recursive tree traversal python. .