Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. void
  2. c_function(void *ptr) {
  3. int i;
  4.  
  5. for (i = 0; i < 10; i++) {
  6. printf("%p", ptr[i]);
  7. }
  8.  
  9. return;
  10. }
  11.  
  12.  
  13. def python_routine(y):
  14. x = []
  15. for e in y:
  16. x.append(e)
  17.  
  18. x = c_void_p * 10
  19. for e in y:
  20. x[i] = e
  21.  
  22. import ctypes
  23. pyarr = [1, 2, 3, 4]
  24. arr = (ctypes.c_int * len(pyarr))(*pyarr)
  25.  
  26. >>> IntArray5 = c_int * 5
  27. >>> ia = IntArray5(5, 1, 7, 33, 99)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement