import bpy
file = open("C:\\exports\\Voxel 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('Voxel coordinates x,y,z 0'+str(every_frame)+':('
        +str(loc.x)+', '+str(loc.y)+', '+str(loc.z)+')\n')
file.close()