Implement fix python mentioned in issue #454
Allows to call a python function at defined points in the integration loop