Selecting an intersecting point in a line Selecting an intersecting point in a line.
Ideally, all points in the line, not just one.
Just for visualization, here is a line.

And there are the points between the start and end of the line.

I would like to know how, in Python, if you had selected the points A and B (like in the second image), you were able to select ideally not one (but that would be an acceptable answer for something I could work off of), but all the points (1, 2, 3, and 4) between aforementioned A and B.
The important thing is that A and B are random points in 3D space. They are not flat against the ground (for example with coords 0x, 3y, 0z); but they are always connected as a line.
If someone could help me out here, that would be great. The Blender documentation is unfortunately not as good as Adobe's so I can't do everything (really anything) myself anymore.
As HISEROD pointed out, if you click on one vertex to select it, and then hold CTRL before clicking another, you will select the shortest path to that vertex:

If you indeed need a script solution, here it is:
import bpy

index1 = 105
index2 = 165

bpy.ops.object.mode_set(mode = 'OBJECT')
obj = bpy.context.active_object
bpy.ops.object.mode_set(mode = 'EDIT') 
bpy.ops.mesh.select_mode(type=&quot;VERT&quot;)
bpy.ops.mesh.select_all(action = 'DESELECT')
bpy.ops.object.mode_set(mode = 'OBJECT')
obj.data.vertices[index1].select = True
obj.data.vertices[index2].select = True

bpy.ops.object.mode_set(mode = 'EDIT')
bpy.ops.mesh.shortest_path_select(edge_mode='SELECT', use_fill=False)