To follow up with a working example of python via headless blender on the command line, the following 4 lines interactively get me an image of a sphere saved to /tmp/.png
./blender -b --python-console
>>> import bpy
>>> bpy.ops.mesh.primitive_uv_sphere_add(size=3.0,location=(0,0,0))
>>> bpy.ops.render.render(write_still=True)