Codes for Moving armature using python

hi, i actually created this code. Hope it wil be useful for you.

if (o.init == 0):
o.init = 1
g.addActiveActuator(c.getActuator(o.current),1)
elif o.current == o.before:
g.addActiveActuator(c.getActuator(o.before),1)
elif c.getActuator(o.current).getPriority() < c.getActuator(o.before).getPriority():
g.addActiveActuator(c.getActuator(o.before),0)
g.addActiveActuator(c.getActuator(o.current),1)
elif c.getActuator(o.current).getPriority() > c.getActuator(o.before).getPriority():
while c.getActuator(o.before).getFrame() < (c.getActuator(o.before).getEnd()-1):
break
g.addActiveActuator(c.getActuator(o.before),0)
g.addActiveActuator(c.getActuator(o.current),1)