On Sun, May 13, 2012 at 11:58 AM, Stefan Behnel <stefan...@behnel.de> wrote: > David Shi, 13.05.2012 15:25: >> Can anyone tell me how to call and exectute C code in Python? > > Take a look at Cython, a Python-like language that supports native calls to > and from C/C++ code. It translates your code into very efficient C code, so > the wrapping code tends to be very fast (often faster than hand written C > code).
More than just speed -- it's, IME, way easier to use and debug than ctypes (thanks to having incredible gdb support and compiler warnings). I swear, this is black magic: http://docs.cython.org/src/userguide/debugging.html Now if only my editor would bold those "cdef"s... :) -- Devin -- http://mail.python.org/mailman/listinfo/python-list