I am using ctypes to wrap a C-library (which I have control over) with Python. I want to wrap a C-function with declaration:
int fread_int( FILE * stream );
Now; I would like to open file in python, and then use the Python file-object (in some way??) to get access to the underlying FILE * object and pass that to the C-function:
# Python
fileH = open( file , "r")
value = ctypes_function_fread_int( ????? )
fileH.close()
Is the Python file <-> FILE * mapping at all possible?
Joakim