I have a list of coordinates and am trying to ouptput the distance between each coordinate into a new list.
((x1,y1,z1),(x2,y2,z2),...)
End resulst
((x2x1),(y2y1),(z2z1)),...
Thus far my strategy is to use the enumerate function to create a new array offset from the original array, and then subtract them.

#creates a list called dataList from and external coordinates file

dataList = [[float(s) for s in item.strip().split(",")] for item in open("coordinates.txt").readlines()]


#creates an empty new array

new_array=[]


#enumerates the list

for i,points in enumerate(dataList):

x,y,z = points

x2,y2,z2 = dataList[i+1]

new_array.append((x2x, y2y, z2z))


print new_array


I get the following error:
File "C:\Python27\coordinate scheme.py", line 9, in <module>
x2,y2,z2 = dataList[i+1]
IndexError: list index out of range
I'm new at Python and especially workining with nested lists and am stuck on where to go from here.
Can you make recommendations on how to address this? Not really sure what list index out of range refers too.
Thanks