全部博文(164)
发布时间:2013-07-31 17:42:50
1、linuxany.c代码如下:#include "stdio.h"void display(char* msg){ printf("%s\n",msg);} int add(int a,int b){ return a+b;}2、编译c代码.........【阅读全文】
发布时间:2013-07-31 16:32:56
Here's a demo:from ctypes import * foo = (c_char * 4)() #char数组foo.value = "foo" print foo.raw # => 'foo\x00' foo_ptr = cast(foo, c_char_p) print foo_ptr.value # => 'foo'......【阅读全文】
发布时间:2013-07-31 16:30:09
This article explains how to write a DLL/SO in C/C++ for PythonNote: Cython can also be used to create and wrap C libraries for Python, and might be a good alternative to the approach explained in this article.Create a new file and write, for example, a function .........【阅读全文】