ctypes

    0热度

    2回答

    我试图将一些诊断添加到嵌套的ctypes结构,但未能如此,并想知道原因。什么作品如预期的那样裸机例如: import ctypes class FirstStruct(ctypes.Structure): _fields_ = [('ch', ctypes.c_ubyte)] f = FirstStruct() print type(f) print hasattr(f,

    0热度

    2回答

    我做了一个需要执行C函数的Python应用程序。为此,我使用gcc将C函数编译到共享库中,并使用ctypes在我的Python脚本中调用该库。 我试图在pip包中打包我的应用程序,但发现无法在pip安装时创建共享库。 我尝试以下(setup.py): from setuptools import setup from setuptools.command.install import insta

    0热度

    1回答

    我有一个C结构如下所示: typedef struct _DXYZ { DXYZSTATE State[]; } DXYZ, *PDXYZ 本质上,的DXYZSTATE阵列,未知大小的。 当我试图在​​中声明这个结构时,我不知道该怎么做。 class DXYZ(Structure): _fields_ = [ ('State', ???) ] 我

    0热度

    1回答

    说完看着这样一个问题: ctypes: How do I define an array of a structure as a field of another structure? 现在我想实现我的版本的解决方案,但在len_a的struct Arr输出不同于它在C中的设置。我的问题是:什么是将Parse.arr设置为python中的一个Arr对象数组的正确方法是什么?(最初是在C中分配/设置

    0热度

    1回答

    按照GSL文档的签名是: double gsl_stats_correlation (const double data1[], const size_t stride1, const double data2[], const size_t stride2, const size_t n) 当我尝

    0热度

    1回答

    下面 typedef struct _node_t { int value; struct _node_t* next; } node_t; 的c头可译为像的下方。 class node_t(Structure): pass node_t._fields_ = [ ('value', ctypes.c_int), ('next', POINTER(n

    0热度

    2回答

    Ç阵列我有一个C函数: void func(int n, int m) { int Array[n][m]; make_magic(Array); } 这使得2D阵列和处理它。我在python3.5使用本功能与ctypes的是这样的: from ctypes import * magic = CDLL('lib_name') magic.func(n,m) 所

    0热度

    1回答

    我们使用有源RFID建设项目,该RFID需要在Python来进行编码,以便使用它在树莓PI3有源RFID SAAT RFID已经有DLL文件, RFIDAPI.lib和RFIDAPIEXPORT.h和各种API调用函数 例如和基本代码,我需要执行 bool SAAT_TCPInit (void** pHandle,char *pHostName,int nsocketPort) HANDLE h

    1热度

    1回答

    我有一个包含原始字段(int,uint8,...)和指针的结构。 这些指针通常指向一个不同结构类型的数组,以保持深度嵌套结构。 例如,在C: struct A { int field1; int field2; struct B *fields3; unsigned int countofb; } struct B { int anotherfield1; i

    0热度

    1回答

    我一直负责在python中使用 ctypes创建一个包装类。我一直在编写和研究过去几周的 ,并有任何愿意帮助的人的问题。这个C代码是我正在使用的代码的最佳复制,所以请记住,我没有按照提供的方式构建代码! 我是比较新的Python和的ctypes的图书馆 在Linux上 Question: When I try to run the following python code, I get this