blender 2.6 pose bone using python

hi everyone
I have a rigged face and I want to pose its bones using python in blender 2.6 but I don’t know how to do that
can anyone help me please?

The Object that represents your Armature will have a ‘pose’ member. The ‘pose’ has a collection of PoseBone objects in its ‘bone’ list. You can manipulate the PoseBone.matrix parameter to change the poses.

The following code assumes that you have an Object selected that represents an Armature


armObj = bpy.context.active_object  # This is an 'Object' type.
pose = armObj.pose   # This is a 'Pose' object
pBone = pose.bones[0]    # This is the first PoseBone object.  You can also look these up by the name of the bone

# Moves this bone .5 units by directly access X-translation component of the matrix.
pBone.matrix.col[3][0] = pBone.matrix.col[3][0] + 0.5


pBone.matrix.col[3][0] = pBone.matrix.col[3][0] + 0.5

nicer:

pBone.matrix.col[3][0] += 0.5