The Python FFI module provides an interface to call C functions from Python, and to create Python callback functions that can be called from C. It can be used to interface with Fortran as well, ...