问题是,如果我理解正确,如何从Python调用C函数。那么,最好的选择是Ctypes(顺便说一句,在所有Python变体中都是可移植的)。
>>> from ctypes import *
>>> libc = cdll.msvcrt
>>> print libc.time(None)
1438069008
>>> printf = libc.printf
>>> printf("Hello, %s\n", "World!")
Hello, World!
14
>>> printf("%d bottles of beer\n", 42)
42 bottles of beer
19
有关详细指南,请参阅
my blog article
.