假设我用Python编写了以下代码:
def subThread():
libc.foo(56)
def mainThread():
libc.foo(56)
child = threading.Thread(target=subThread)
child.start()
在C中,foo看起来像:
void foo(int a){
printf("foo: %d\n", a);
}
通过执行python程序,我将得到以下输出
foo: 56
foo: 130810240
以前有人遇到过这种情况吗?有什么解决办法吗?你知道吗
提前谢谢。你知道吗
您是如何编译C函数以使用python的?这个方法(https://docs.python.org/2/extending/extending.html)需要在C端进行更复杂的参数解析。你知道吗
相关问题 更多 >
编程相关推荐