How to call C++ from Python

1. Description

        Python is a high-level programming language that can call functions written in other languages. There are two ways to call C functions in Python: 1) use the ctypes library provided by Python; 2) use the Cython library provided by Python.

        Note: You can download the complete code for this example in this repository . If you have any comments on this article, you can start an issue there, or contact me .

Two, PyBind11 vs ctypes

        There are basically two ways to call C++ from Python: Generate Python modules using the PyBind11 C++ library

Guess you like

Origin blog.csdn.net/gongdiwudu/article/details/131968528