Print object as tree shape in python