Getting stdout from ctypes module

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Mon Mar 5 20:29:55 EST 2007


En Fri, 02 Mar 2007 07:54:55 -0300, Massi <massi_srb at msn.com> escribió:

> Hi everyone, I have a program which is written in C and interfaced
> with python via
> Ctypes.  The functions I call print stuff out to the console, using
> the usual function printf. I would like to know if it is possible to
> redirect the output of my C module to python. I'm working on windows
> environment. Thanks in advance.

Is it a DLL or a program?
For a program I don't see how you could use ctypes to invoke things - and  
for a DLL it's strange to use printf for output.
If you run it as a program, try the subprocess module.

-- 
Gabriel Genellina




More information about the Python-list mailing list