I'm writing a small program (the one below) that embeds python in a C++ code.
#include <Python.h>
int main()
{
int x;
Py_Initialize();
const char* pythonScript = "print 'Start'"
PyRun_SimpleString(pythonScript);
/*
assign a python variable 'n' to 'x' i.e n=x
*/
Py_Finalize();
return 0;
}
My requirement here is that i assign the python variable 'n' the value of C++ variable 'x'. Is there a way to do this?
Thanks in advance.