I would like to do the equivalent of a print in python from a library I wrote in C++. I am using Boost 1.60.0 and Python 2.7.
I found the following sites :Mantid and WikiBooks. From what I understood this code should work, but nothing is printed.
cpp file
void greet()
{
std::cout<<"test_01\n";
std::cout<<"test_02"<<std::endl;
printf("test_03");
}
BOOST_PYTHON_MODULE(PythonIntegration)
{
def("greet", greet);
}
py file
import PythonIntegration
PythonIntegration.greet()
I checked if the function was called by making it return something and it works, but still nothing is printed.
Thank you for your help