Hey guys, here is another simple script that I have found invaluable. Basically whilst rigging, I find that numerous times I need to create 'midJoints' between a startJoint and an endJoint. 

Here it is, feel free to use it around where you see fit in your everyday toolsets.

import maya.cmds as cmds
import maya.OpenMaya as OpenMaya

def createMidJoints(startJoint, endJoint, steps= 2):
  sPos= cmds.xform(startJoint, q=1, ws=1, t=1)
  ePos= cmds.xform(endJoint, q=1, ws=1, t=1)

  vecA= OpenMaya.MVector(sPos[0], sPos[1], sPos[2])
  vecB= OpenMaya.MVector(ePos[0], ePos[1], ePos[2])
  vecC= (vecA - vecB)/ (steps+1)

  prefix= startJoint.rpartition("_")[0]
  twistJoints= []

  for i in range(steps+1):
    pad= len(str(steps+1))+1
    midJointName= prefix+"Mid"+str(i+1).zfill(pad)+"_ctlJNT"
    joint= cmds.duplicate(startJoint, po=1, n= midJointName)[0]

    cmds.parent(joint, startJoint)
    vecMid= vecA - (vecC*(i+1))
    cmds.xform(joint, ws= 1, t= [vecMid.x, vecMid.y, vecMid.z])

  for index in range(len(twistJoints)):
    if not index== 0:
      cmds.parent(twistJoints[index], twistJoints[index-1])


  cmds.parent(endJoint, twistJoints[-1])

  return twistJoints