Redirecting I/O in embedded Python

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


Hi,

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

-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de



More information about the Python-list mailing list