How to make a bone active?
API properties.

Set the active bone with arm.edit_bones.active = bone.  However propose there is no need to use the parenting operator, can rather set the properties, parent, use_connect

Python console code with armature arm in edit mode.

&gt;&gt;&gt; arm
bpy.data.armatures['Armature']

&gt;&gt;&gt; bone = arm.edit_bones["Bone"]
&gt;&gt;&gt; bone2 = arm.edit_bones["Bone.001"]
&gt;&gt;&gt; # active edit bone
&gt;&gt;&gt; C.active_bone.name
'Bone.001'
# set active edit bone
&gt;&gt;&gt; arm.edit_bones.active = bone
&gt;&gt;&gt; C.active_bone.name
'Bone'
&gt;&gt;&gt; bone2.parent = bone
&gt;&gt;&gt; bone2.parent.name
'Bone'
# check if connected.. nope
&gt;&gt;&gt; bone2.use_connect
False
# connect
&gt;&gt;&gt; # connect the bone
&gt;&gt;&gt; bone2.use_connect = True
&gt;&gt;&gt;