This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jan 15th, 2013  |  syntax: Python  |  size: 0.41 KB  |  views: 5  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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')
clone this paste RAW Paste Data