Aligning empty object with Bezier curve point using Python
Use the follow path constraint

When it comes to putting an object at either end of a curve, the follow path constraint, with fixed location, follow curve. An offset factor of 0 is one end, 1 the other.



import bpy

context = bpy.context
bez = context.object

bpy.ops.object.empty_add(location=(0, 0, 0))
mt1 = context.object
fpc = mt1.constraints.new(type='FOLLOW_PATH')
fpc.target = bez
fpc.use_curve_follow = True
fpc.use_fixed_location = True
# dupe it
bpy.ops.object.duplicate()
mt2 = context.object
mt2.constraints[0].offset_factor = 1