Animation nodes - Data Interface Import Problem

I have animation in Animation nodes. There is an Expression node, each frame the value of the result changes. I connected Expression node result with node “Data interface” (“export mode”). I have a python script that has a My_Print_Res() function that is placed with bpy.app.handlers.frame_change_post.append (My_Print_Res()).

My_Print_Res() prints the result value from the Data Interface to the console: print (bpy.data.node_groups ['AN Tree']. nodes ["Data Interface"]. value).

Now let’s see what happens: I run the script, then I start the animation in the Timeline with the “Play Animation” arrow. The problem is that the first time it prints the value, the second time and other times an error occurs - TypeError: ‘NoneType’ object is not callable. Can you please tell me what is my mistake?

I found how to fix it - need to use lambda:

bpy.app.handlers.frame_change_pre.append(lambda e: Pr())

thank you all