On finished render callback issue


Using your Python API, I would like to know what is the proper way of passing a callback function to an OnRenderMovieStopped object.
I wrote a python script that renders a level sequence, and pass in a function to run as a callback once the render is done. And I am puzzled why my callback does not kickoff when my rendering script is wrapped in a function (Otherwise, the callback runs well if you run the raw body of my function into the Output Log terminal). Please see my script in attachment below.

Thank you.

Simon Z.