a line tree in python