Changing rotation during animation

I was using bpy.app.handlers.frame_change_post.append(someFunction) to run a function every animation frame to take advantage of being able to use forces, this worked my ridgid body cube moved. I then tired to update the rotation of the cube bpy.data.objects[“cube”].rotation_euler[angle] += value to be able to rotate the cube it’s moving. This hasn’t worked, I can see the changing angle through the layout page but the cube’s actual rotation does not change, is there a fix? or anther way to apply forces?
I’m using blender 2.92.0
Thanks