Use Boost to embed Python code in the program
#include
Using namespace boost :: python;
Int main () {
Py_initialize ();
handle <> main_module (borrowed (PyImport_AddModule ( "__ main__"))); handle <> main_namespace (borrowed (PyModule_GetDict (main_module.get ()))); handle <> (PyRun_String ( "hello = file ( 'hello.txt' , 'W') / N "" Hello.write ('Hello World!') / N "" Hello.close () ", PY_FILE_INPUT, Main_NameSpace.get (), main_namespace.get ());
PY_FINALIZE ();
}