How can I output the Compositor result instead of the Render Result when rendering an animation?
I found a simple solution to this problem using Python:
import bpy

def render(rex_x, res_y):
    oldx = bpy.context.scene.render.resolution_x
    oldy = bpy.context.scene.render.resolution_y
    outpath = bpy.context.scene.render.filepath

    try:
        bpy.context.scene.render.resolution_x = res_x
        bpy.context.scene.render.resolution_y = res_y
        bpy.context.scene.render.filepath = ''
   
        bpy.ops.render.render(animation=True, write_still=False)

    finally:
        bpy.context.scene.render.resolution_x = oldx
        bpy.context.scene.render.resolution_y = oldy
        bpy.context.scene.render.filepath = outpath

The try/finally is to put back the original values in case of semi-catastrophic failure (which actually happened to me just now since my script is more complicated than the minimum version posted here).  In my case I also needed to alter the resolution, which cannot be driven using a Driver.  So, two birds and all that...