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

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -