Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/326.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在c应用程序中嵌入python intepreter_Python_Linux - Fatal编程技术网

在c应用程序中嵌入python intepreter

在c应用程序中嵌入python intepreter,python,linux,Python,Linux,我有一个在linux上运行的大型C应用程序。我想在我的应用程序中嵌入一个python-3.6解释器。据我所知,这只是在编译和执行过程中包含python源代码的问题: #include <Python.h> void exec_interactive_interpreter(int arg, char** argv) { Py_Initialize(); Py_Main(argc, argv); Py_Finalize(); } #包括 void exec_交互式_解释器

我有一个在linux上运行的大型C应用程序。我想在我的应用程序中嵌入一个python-3.6解释器。据我所知,这只是在编译和执行过程中包含python源代码的问题:

#include <Python.h>
void exec_interactive_interpreter(int arg, char** argv)
{
  Py_Initialize();
  Py_Main(argc, argv);
  Py_Finalize();
}
#包括
void exec_交互式_解释器(int-arg,char**argv)
{
Py_初始化();
Py_干管(argc、argv);
Py_Finalize();
}
从我的代码。但是,我不确定编译过程是如何工作的。我没有看到任何主生成文件。我的应用程序makefile应该如何编译python源代码