Friday, August 3, 2012

Invoking native C/C++ libs using python

So as a continuation of the last post http://orphanware.blogspot.com/2012/08/making-c-available-through-native-calls.html...here is what you have to do with python

This one is super ez!
from ctypes import cdll
from ctypes import c_char_p
from ctypes import c_float

lib = cdll.LoadLibrary('libmylib.so')
helloWorld = lib.MYLIB_helloWorld

helloWorld()

No comments:

Post a Comment