How to receive a FILE* from Python under MinGW?

John Pye john.pye at gmail.com
Sun Mar 25 04:35:55 EDT 2007


On Mar 24, 5:37 am, "Gabriel Genellina" <gagsl-... at yahoo.com.ar>
wrote:
> En Fri, 23 Mar 2007 16:34:22 -0300, Gabriel Genellina
> <gagsl-... at yahoo.com.ar> escribió:
>
> >> What about calling mscvrt_get_osfhandle from inside the SWIG wrapper?
> >> I tried this but it seemed that the function was not exported to the
> >> DLL.
>
> > The idea is to separate both worlds - _get_osfhandle must be called from
> > the C runtime used by Python, not the one linked to your extension.
>
> Ah, but you could import the msvcrt module and get it from there. *ONLY*
> get_osfhandle. The other function, open_osfhandle, must be from the
> runtime used by your extension.
>
> --
> Gabriel Genellina

Yes, that was what I was hoping might be possible. Have not had any
luck with that yet though.

Cheers
JP




More information about the Python-list mailing list