I've been trying to integrate C code into Python under Linux and I came up with the following problem: ¿is it possible to share an already opened file between C and Python? I mean a C FILE and a Python file object.
The C function which I'm struggling with is called exhaustively, so I'd like to avoid opening/closing the file each time this happens and pass the opened file from Python to C. I'm open to any efficient solution.