17 std::string initCommand(
"import FWCore.ParameterSet.Config as cms\n" 20 initCommand += iPythonFileName+
"',fileDict)";
26 boost::python::handle<PyObject>(borrowed(PyImport_AddModule(const_cast<char *>(
"__main__"))))));
27 object main_namespace = main_module.attr(
"__dict__");
30 object result((boost::python::handle<>(PyRun_String(initCommand.c_str(),
33 main_namespace.ptr()))));
34 }
catch(error_already_set
const&) {
39 object result((handle<>(PyRun_String(command.c_str(),
42 main_namespace.ptr()))));
43 returnValue= extract<std::string>(
result);
45 }
catch( error_already_set
const& ) {
void pythonToCppException(const std::string &iType)
std::string pythonFileToConfigure(const std::string &iPythonFileName)