Export animation curve as values? I'd like to use the Graph Editor to create animation curves for use in another software package. Is there a way to export the value of a curve for each frame?

For example, I have a keyframe at frame 1 and one at frame 24. The first keyframe has a value of 0 and the second one has a value of 24. There's a Bezier interpolation between the two keyframes. I'd like to get the value for each frame in the curve.

Is this possible? Possibly a Python solution? (I'm comfortable with programming)
The fcurve class provides the .evaluate
 method to get the value for a given frame.

import bpy

action = bpy.data.actions['CubeAction']
for fc in action.fcurves:
    if fc.data_path == 'location' and fc.array_index == 0:
        break
val = fc.evaluate(5.5)