How to output skeleton 3D coordinates after posing?

I am a newbie in blender.
I feel confused when looking at the python 2.61 api doc.

I have successfully output the posed mesh in the following way.

me =['figure'] 
mesh = me.to_mesh(sce, APPLY_MODIFIER, 'PREVIEW') 

#output vertices and faces to a .obj file

But when I am going to output the armature of this mesh, I don’t know how to do.
Any advice?


I thought head_local is relative to its parent, and head is relative to the world.

Finally the code is simple.

ama =['Armature']
matg = ama.matrix_world.copy()
for obj in
    if obj.type == 'ARMATURE':
        bones =;
        for ab in bones:
            pt_head_global = matg * ab.head_local
            pt_tail_global = matg * ab.tail_local

Then coordinates are in the world CS.