【发布时间】:2017-01-22 23:53:13
【问题描述】:
在 C 库中有:
typedef struct A * B;
int create_b(B* b);
并且使用 ctypes 我需要 Python 等价于:
B b;
create_b(&b)
结构 A 在 Python 中实现为 class A(ctypes.Structure)。
所以,我尝试了:
b = ctypes.POINTER(A)
lib.create_b(ctypes.byref(b))
但它不起作用。有很多类似的问题,但我尝试过的都没有帮助。
【问题讨论】:
-
它在什么方面不起作用?