-
-
Save framsc/d78be68a14f84150fa2b7a1ff256c6b4 to your computer and use it in GitHub Desktop.
python ctypes - array conversion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#let's say f_TI is something like | |
#void blabla(int *data, int data_length); | |
#then | |
f_TI.argtypes = [ctypes.POINTER(ctypes.c_int), ctypes.c_int] | |
lll = [4,7,2,8] | |
lll_c = (ctypes.c_int * len(lll))(*lll) | |
f_TI(lll_c, len(lll)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment