检测高手的时候到了 how to convert my c code into python ? struct Header{ int f1; int f2; }; struct Data{ long f3; unsigned short f4; ... }; struct Info{ struct Header myHeader; struct Data mhData; }; struct Info myInfo; // initialization here myFunc(&myInfo, 1, 2, 3);
【在 w*s 的大作中提到】 : 检测高手的时候到了 : how to convert my c code into python ? : struct Header{ : int f1; : int f2; : }; : struct Data{ : long f3; : unsigned short f4; : ...
Header = [('f1', 'i4'),('f2', 'i4')] Data = [('f3', 'i8'),('f4','u4'),...] Info = [('myHeader',Header), ('mhData',Data)] myinfo = np.array(((0,0), (0,0)), dtype=Info) myfunc(myinfo, 1, 2, 3) 另 in python don't use camel case name for variables and functions, that's quite ugly.
【在 w*s 的大作中提到】 : 检测高手的时候到了 : how to convert my c code into python ? : struct Header{ : int f1; : int f2; : }; : struct Data{ : long f3; : unsigned short f4; : ...