I'm trying to parent an object to a bone in python without using operator So I did this :
object = bpy.data.objects['object']
armature = bpy.data.objects['Armature']
bone = armature.pose.bones['bone']
object.parent = armature
object.parent_bone = bone.name
object.matrix_parent_inverse = bone.matrix_local.inverted()
the object is on the tail of the bone it must be on the head What should I do?