Add an exec_python hook