simple verts detection on a line

import bpy
import bmesh

obj = bpy.context.scene.objects.active
m = obj.data
bm = bmesh.new()
bm.from_mesh(m)
bm.verts.index_update()

verts = []

# [6] [12] are examples
firstV = bm.verts[6]
secondV = bm.verts[12]

verts.append(firstV)
verts.append(secondV)

for v in bm.verts:
    for e in v.link_edges:
        vv = e.other_vert(v)
        print(v.index, obj.matrix_world *v.co, vv.index)
        
def findGrandChild(v, vv):
    for e in vv.link_edges:
        vvv = e.other_vert(vv)
        if vvv.index != v.index:
            if vvv.index == firstV.index:
                break
            verts.append(vvv)
            findGrandChild(vv, vvv)
           
findGrandChild(firstV, secondV)
for x in verts:
    x.index

# show results
# do not forget matrix_world
for x in verts:
    print(x.index, obj.matrix_world * x.co)

for x in verts:
    print(x.index, obj.matrix_world * x.normal)