starting rewrite of pathcalc.tcl in python