4 ms·
Calling Go Functions from C/Python/Ruby/Node/Java
- bsdz 5y agoThis article might be a little outdated now (2017). Recently, I've enjoyed using the Python cffi module to interface with C libraries: # not tested! this_dir = Path(__file__).parent ffi = cffi.FFI() ffi.cdef((this_dir / "awesome.h").read_text()) lib = ffi.dlopen(str(this_dir / "awesome.so")) print("awesome.Add(12,99) = %d" % lib.Add(12,99))