Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void
- c_function(void *ptr) {
- int i;
- for (i = 0; i < 10; i++) {
- printf("%p", ptr[i]);
- }
- return;
- }
- def python_routine(y):
- x = []
- for e in y:
- x.append(e)
- x = c_void_p * 10
- for e in y:
- x[i] = e
- import ctypes
- pyarr = [1, 2, 3, 4]
- arr = (ctypes.c_int * len(pyarr))(*pyarr)
- >>> IntArray5 = c_int * 5
- >>> ia = IntArray5(5, 1, 7, 33, 99)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement