Can't write animated camera motion to a file

Hi !
I’m trying to write my camera animated motion path (position and orientation) to a file. I animate my camera doing follow a path (witch is a Bezier Curve) from my 3d view.
When using th Python console, I get some changed orientation and position informations from the matrix_world attribute of my camera object when changing my active frame.

Unfortunately, when using a script to write it in a file I can’t see any changes into the camera matrix_world since I always write the end frame version of it.
My script is :


import bpy  
 
myCam=[]
for obj in bpy.data.objects:
    if (obj.type=='CAMERA'):
        myCam.append(obj.name)
        
bpy.data.scenes[0].frame_start=1
bpy.data.scenes[0].frame_end=300

fo=open('/home/victoire/Desktop/myCamCoord.txt','w')

for cam in myCam:
    print("="*40) # printing marker 
    fo.write(str(bpy.data.objects[cam].name)) 
    fo.write("
")        
    fo.write("frame location orientation ")
    fo.write("
")
    for i in range(0,300):
        bpy.data.scenes[0].frame_current=i+1
        #bpy.data.scenes[0].update()
        p, q, s= bpy.data.objects[cam].matrix_world.decompose() #always gives end loop value
        fo.write(str(bpy.data.scenes[0].frame_current))
        fo.write(" ") 
        fo.write(str(p))
        fo.write(" ") 
        fo.write(str(q.to_euler("XYZ")))
        fo.write("
")   
       
fo.close()

Someone could tell me how to solve this ?

thanks