Hooking selected object to control point of Bezier curve via scripting I'm trying to hook an object - namely a cube, which is a Mesh - to a specified control point of a Bezier curve - which is a Curve - by scripting.
So I do the following and it doesn't work:

bpy.data.objects['Cube'].select = True # it has to be selected
bpy.data.objects['BezierCircle'].select = True # it has to be selected too
# and it has to be the active one as well
bpy.context.scene.objects.active = bpy.data.objects['BezierCircle'].splines[0].bezier_points[0]


It says that it doesn't find the 'splines' attribute. OK, so if I change it to a curve, like this:

bpy.data.objects['Cube'].select = True 
bpy.data.objects['BezierCircle'].select = True 
bpy.context.scene.objects.active = bpy.data.curves['BezierCircle'].splines[0].bezier_points[0]


then it says that it is expecting an Object, and not a BezierSplinePoint.

If it would be accepted, the following command should do the hooking:

bpy.ops.object.hook_add_selob(use_bone = False)


So that the Cube would be hooked to the control point I'm indexing.

Now what do you suggest I should do?
OK guys, I think I found the solution! Here: https://www.youtube.com/watch?v=ImWd1-FxhE4

In case the video becomes deleted in the future for some reason, here is the key to selecting the desired control point: (just an example)

bpy.data.curves['BezierCurve'].splines[0].bezier_points[0].select_control_point = True


So basically there is this boolean data member of the control points called select_control_point and you just have to set it to true.