Python ctypes DLL stdout -
I am calling a DLL function from Python using ctypes, and just want to capture stdout with dll call I am
How would I go about doing this?
It seems that you have to make an effort to do something like this:
four * colsoffunk () {ostrstream ostr; Cout.rdbuf (ostr.rdbuf ()); SomeFunc (); Char * s = ostr.str (); Return s; }
You will actually need to separate that string, instead of returning it; I will leave that part to you. The string pointer becomes invalid as soon as it is returned, but you can make a fairly simple allocation till you want to remove the memory after it is returned.
Comments
Post a Comment