将python脚本添加到c ++项目 [英] Adding python script to c++ project

查看:209
本文介绍了将python脚本添加到c ++项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何将一个用python编写的脚本添加到c ++项目?感谢



编辑:基本上所有的脚本都是电子邮件一些数据。我想传递数据,也许电子邮件地址到python写的函数。希望清除东西..

解决方案

您可能对 Boost.Python:嵌入解释器 Python / C API:嵌入Python解释器。您可以直接使用Python C API,也可以使用Boost.Python库。您可能还有兴趣阅读将Python嵌入您的C程序,您可以通过它了解详情。 p>

How would I go about adding a script written in python to a c++ project? Thanks

Edit: Basically all the script does is email some data. I would like to pass the data and maybe the email address to a function written in python. Hope that clears things up..

解决方案

You may be interested in Boost.Python: Embedding the Interpreter, or Python/C API: Embedding the Python Interpreter. You can either use the Python C APIs directly or use the Boost.Python library as you so choose. You might also be interested in reading Embedding Python in Your C Programs which walks you through it.

这篇关于将python脚本添加到c ++项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆