Python: Foreign Function Interface

18th February 2020 at 10:30am

Gerneral Guides


Due to the lack of ABI standard of C++ language, there is no portable way to use C++ library among different operating systems and platforms (Refer).

  • Cython [C/C++]: popular and useful, consider this first
  • ctypes [C]: lies in standard library and pretty easy to use
  • CFFI [C]: popular and practical
  • SWIG [C/C++]: not just focusing Python but TCL and other script languages
  • Boost.Python [C/C++]: may require many knowledge on Python C library