Advertisement
Guest User

Untitled

a guest
Jan 15th, 2013
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. import ctypes as C
  2.  
  3. lib_path = './'
  4. lib_name = 'ct.dylib'
  5.  
  6. print('loading dll... from ' + str(lib_path) + str(lib_name))
  7. myclib = C.CDLL(lib_path + lib_name)
  8.  
  9. print('loaded')
  10.  
  11. genTest = myclib.genTest
  12.  
  13. genTest.argtypes = [C.c_char_p]
  14. genTest.restype = C.c_int
  15.  
  16. print('test start')
  17. res = genTest(C.c_char_p(str("abc")))
  18. print ('test half done')
  19. res = genTest(C.c_char_p(None))
  20. print ('test successful')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement