
11 May
2009
11 May
'09
4:11 p.m.
Hi, I would like to print from C++ to the same stream as Python's 'print' command does. I am using an embedded Python shell and when using std::cout nothing is printed at all... Currently I am using the following code: std::ostringstream oss; oss << "test\n"; std::string cs = oss.str(); PySys_WriteStdout(cs.c_str()); I wonder if there is an easier way to get the same result? Thanks, Dietrich