C程序到python模块的swig转换流程
程序参考:http://www.swig.org/Doc3.0/SWIGDocumentation.html#Introduction_nn4
0、swig下载与安装
下载链接(http://www.swig.org/download.html)
安装方法(http://www.swig.org/Doc4.0/Preface.html#Preface_installation)
1、编辑待转C程序 example.c
/* File : example.c */
double My_variable = 3.0;
/* Compute factorial of n */
int fact(int n) {
if (n <= 1)
return 1;
else
return n*fact(n-1);
}
/* Compute n mod m */
int my_mod(int n, int m) {
return(n % m);
}
2、编辑swig的转换接口文件 example.i
/* File : example.i */
%module example
%{
/* Put headers and other d