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')