GUIs - A Modest Proposal

Martin v. Loewis martin at v.loewis.de
Sat Jun 12 20:25:03 EDT 2010


> Would it be possible to write a program that converts a module that uses
> ctypes to interface to a dll to a corresponding C extension program that
> would compile to a drop in replacement extension module?

If implemented at all, I think the ctypes implementation itself could do
that. I.e. create all the function objects, let the Python script 
declare the APIs, and then generate C code from those signatures.

The C code would then best be adjusted: you'd rather use the struct 
declarations from the header files instead of the one you learned from 
ctypes (which may be wrong, or processor-dependent, or 
version-dependent). So a manual adjustment of header files would be 
necessary afterwards.

Regards,
Martin



More information about the Python-list mailing list