[Python-Dev] Replacing PyWin32's PeekNamedPipe, ReadFile, and WriteFile

Thomas Heller theller at ctypes.org
Thu Jul 23 17:35:12 CEST 2009


Jean-Paul Calderone schrieb:
> On Thu, 23 Jul 2009 14:21:38 +0200, Christian Heimes <lists at cheimes.de> wrote:
>>Michael Foord wrote:
>>> A big advantage of using ctypes is that it works cross-implementation -
>>> on IronPython and PyPy already and on Jython soon. I'd like to see more
>>> standard library modules use it. Distributions that choose not to
>>> include it are crippling their Python distribution.
>>
>>Interesting, I didn't know that IronPython supports ctypes, too. I still
>>find ctypes a bit problematic because it doesn't us header files for its
>>types, structs and function definitions.
> 
> This is indeed a big problem with ctypes.  Fortunately, a project exists
> to correct it:
> 
>     http://pypi.python.org/pypi/ctypes_configure/0.1
> 
> Anyone writing code with ctypes should be looking at ctypes_configure as
> well.

There is also another project that uses gccxml to parse the header files
and generate ctypes-compatible code.

http://web.archive.org/web/20080115092648/starship.python.net/crew/theller/wiki/CodeGenerator

Especially well on Windows works the dynamic, on-demand code generation.

http://web.archive.org/web/20080115092648/starship.python.net/crew/theller/wiki/CodeGenerator/DynamicModule

I do all win32 api programming with this stuff.

I should note that the ctypeslib project is not well maintained because
I don't have the time for that any longer.

-- 
Thanks,
Thomas



More information about the Python-Dev mailing list