import Blender

def exploreChild(bo):
   cbos = bo.getChildren()
   for cbo in cbos:
      print cbo.name + " child of " + bo.name
      if cbo.getChildren():
         exploreChild(cbo)


arm = Blender.Armature.Get("Armature")

rbos = arm.getBones()

for rbo in rbos:
   exploreChild(rbo)