我有一个简单的 C 函数。
typedef struct { long unsigned int First; long unsigned int Second; int c; } FRAGMENTS; struct out { long unsigned int Four; FRAGMENTS fragments[10000]; }; struct out test() { struct out *out = (struct out *)malloc(sizeof(struct out)); ... return *out }
如何在 Python 中使用这个函数?将此结构转换为 python 对象(使用 python 包装器)的任何示例?
最佳答案
您是否已经将数据“保存在”Python 中(即来自网络或二进制文件)?比你使用 struct模块。
关于python - 如何在 python 中使用 c 结构?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7084726/