Position armature bone's head and tail

I can create chain of bones like following …

bpy.ops.object.armature_add(enter_editmode=True, location=(0,0,1))

bpy.ops.armature.extrude_move(TRANSFORM_OT_translate={"value":(1,0,0)})

I wanted to know how to change the position of the bones tails so that I can create the chain shape I want.
If I change the position of the head and tail of the bone, below is the output in the debug window. But it does not tell me how to select either the head or the tail.

bpy.ops.transform.translate(value=(0.10286, 0, 0), constraint_axis=(True, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1, release_confirm=True)

Any help would be appreciated.
Thanks

You should avoid operators as much as possible. It will make it much easier to create your armature with RNA methods, see e.g.

http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Cookbook/Code_snippets/Armatures

Thanks @CoDEmanX!

Would you know any such example where tracked constraints are used.