How can I make dynamic text in an animation?
Building off the answer in how to animate string properties, here's a solution.  You can insert the following code in the Text Editor and hit Run Script.

Example: display current frame

Assuming your text object is called 'Text', this will have it read the current frame:

import bpy

scene = bpy.context.scene
obj = scene.objects['Text']

def recalculate_text(scene):
    obj.data.body = 'Current frame: ' + str(scene.frame_current)

bpy.app.handlers.frame_change_pre.append(recalculate_text)


The last line just causes the recalculate_text function to be run each time the frame is changed (more on Application Handlers).

Example: distance travelled by object

To have a text showing the distance travelled by 'Cube':

import bpy

scene = bpy.context.scene
obj = scene.objects['Text']

def recalculate_text(scene):
    x = scene.objects['Cube'].location[0]
    obj.data.body = 'Distance in x-direction: {0:.1f} meters'.format(x)

bpy.app.handlers.frame_change_pre.append(recalculate_text)


where I've used Python's string formatting to make distance only display one decimal place.

Example: time elapsed

import bpy

scene = bpy.context.scene
obj = scene.objects['Text']

def recalculate_text(scene):
    fps = scene.render.fps / scene.render.fps_base  # actual framerate
    obj.data.body = 'Elapsed time: {0:.1f} seconds'.format(scene.frame_current/fps)

bpy.app.handlers.frame_change_pre.append(recalculate_text)


Demo video