Calling a function within an animation

Hi,

I have been trying to use matplotlib and stumbled on plotly as an easier alternative.
I’ve come across this demo: https://plotly.com/python/animations/ - Moving Frenet Frame Along a Planar Curve in particular.

For all these animations the points are calculated before hand. Is it possible to call a function and calculate the points on the go, in real time? If someone could point to the right resource, I’d be very grateful.

Many thanks.