Redirecting I/O in embedded Python

Bertram Scharpf b.scharpf at
Fri Jun 25 14:11:48 CEST 2004


in one of my C programs, I call embedded Python code. Now, I
would like to redirect stdin/stdout to strings I can assign
to/read out within the C code.

This should be a solvable problem creating modules that have
a member function 'write' or 'readline' respectively and
assigning them to sys.stdin and sys.stdout.

Before I do this work, I would like to ask if there is a
reported standard way to do it or if there is even the
finished code to be obtained anywhere on the web.

Thanks in advance,


Bertram Scharpf
Stuttgart, Deutschland/Germany

More information about the Python-list mailing list