C++
Load a 64-bit C++ library in 64-bit Python (view the C++ source code).
To load the 32-bit library in 32-bit Python use '/cpp_lib32'
.
>>> from msl.loadlib import LoadLibrary
>>> from msl.examples.loadlib import EXAMPLES_DIR
>>> cpp = LoadLibrary(EXAMPLES_DIR + '/cpp_lib64')
Call the add
function to calculate the sum of two integers
>>> cpp.lib.add(1, 2)
3