Parenting meshes to bones

parent_bone expects a string, the bone name.


object.parent_bone = "hips"

Have object/s selected, armature active in pose mode, parent bone selected


bpy.context.active_pose_bone
bpy.ops.parent_set(type='BONE')