[Dream] A meta-wrapper module to interface any C dynamic library

Will Stuyvesant hwlgw at hotmail.com
Fri Jul 4 13:26:05 EDT 2003


> [Seo Sanghyeon]
> To see is to believe.
> >>> import ctypes
> >>> loader = ctypes.cdll
> >>> dll = loader.msvcrt
> >>> sin = dll.sin
> >>> sin.argtypes = [ctypes.c_double]
> >>> sin.restype = ctypes.c_double
> >>> sin(3.14)
> 0.0015926529164868282

I love examples like this!  And ctypes is very good, I downloaded the
.EXE installer and ran it and this example works "out of the box".

How do you know what functions are available in "dll"?  Any general
strategy?




More information about the Python-list mailing list