[C++-sig] Evaluating multiple statements

Murray Cumming murrayc at murrayc.com
Tue Jul 6 22:58:40 CEST 2004


I am trying to evaluate arbitrary sets of python statements from C++.
Because PyRun_String (with Py_eval_input) can only evaluate single
lines, I have found a way to do it by compiling and evaluating each
statement in sequence.

However, this really doesn't look like the best way to do this, and I
don't think it can handle complex constructs, so I'd welcome advice:
http://www.murrayc.com/misc/test_pyembed.cc

-- 
Murray Cumming
murrayc at murrayc.com
www.murrayc.com
www.openismus.com




More information about the Cplusplus-sig mailing list