To calculate distance between two points, you could just do.
import math
def calculateDistance(x1,y1,x2,y2):
dist = math.sqrt((x2 - x1)**2 + (y2 - y1)**2)
return dist
print calculateDistance(x1, y1, x2, y2)
if it is along a line, you could just split the line with the points and use the length of the line for that