Python call c pass a callback function on Linux

Jason Qian jqian at tibco.com
Wed Jan 24 17:16:22 EST 2018


Hi,

  I have following code that works fine on windows.

InvocationCB=WINFUNCTYPE(None, c_char_p, c_int)
submit = lib.submit
submit.argtypes = [ctypes.c_void_p, c_void_p,InvocationCB]
submit.restype = ctypes.c_int

def handleResponse(message, code):
      print('--- handleResponse ---')
      print(message)
      print(code)

class GSPythonDriver(object):
  def submif(self,methodname)
    invm_fn = InvocationCB(handleResponse)
    lib.submit(self.obj,methodname,invm_fn)

 How can I do this on the Linux ?


Thanks for the help
Jason



More information about the Python-list mailing list