简体   繁体   English

如何从Linux中的Python代码调用C ++函数?

[英]How to call C++ functions from Python code in linux?

I want to call functions of a C++ program from Python code. 我想从Python代码调用C ++程序的函数。

How can make C++ functions available in a Python program? 如何使C ++函数在Python程序中可用?

http://www.boost.org/doc/libs/1_47_0/libs/python/doc/ http://www.boost.org/doc/libs/1_47_0/libs/python/doc/

Boost.Python, a C++ library which enables seamless interoperability between C++ and the Python programming language. Boost.Python,一个C ++库,可实现C ++和Python编程语言之间的无缝互操作性。

You can find a simple example of Python's native C API (works just as well for C++) here 你可以找到Python的原生C API的一个简单的例子(作品也同样适用于C ++) 这里

If you deal with numerical calculations and you use numpy in your python code, you should consider numpy's extensive additions to the C API ( manual ) 如果您处理数值计算并且在python代码中使用numpy,则应考虑numpy对C API的广泛补充( 手册

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM