2

I am trying to redirect stdout from DLL. This question asked plenty of times, but I decided to go through this article: redirecting-all-kinds-of-stdout-in-python

The problem is that when I am running this line:

c_stdout = ctypes.c_void_p.in_dll(libc, 'stdout')

I get

ValueError: symbol 'stdout' not found

I am initializing libc unlike the method mentioned in the article since it does not work:

libc = ctypes.CDLL(None)

So I am doing

libc = ctypes.CDLL('msvcrt')

instead, but then again it does not resolve "stdout" which seems essential to the case. Thanks. Any help redirecting output from the dll will be also great.

tituszban
  • 4,797
  • 2
  • 19
  • 30

0 Answers0