import bpy
file = open("C:\\exports\\sperm coordinates.txt", 'w')
scene = bpy.context.scene
loc = bpy.context.object.location
for every_object in bpy.context.scene.objects:
    for every_frame in range(scene.frame_start, scene.frame_end+1):
        scene.frame_set(every_frame)
        loc = every_object.location
        file.write('Sperm coordinates '+str(every_frame)+':('
        +str(loc.x)+', '+str(loc.y)+', '+str(loc.z)+')\n')
file.close()