what does "python -i" use as input stream (stdin)?

Almar Klein almar.klein at gmail.com
Thu Sep 25 14:49:31 CEST 2008

I want to start "python -i" from a subprocess and change its stdin stream,
so I get control over the commands I feed the interpreter.

I thought just changing sys.stdin to my custom file-like object would
suffice, but this does not work. Neither does changing sys.__stdin__.

I guess the interpreter got a reference to the original stdin (the Pipe)
I could change it, and is using that instead of sys.stdin.

Any thoughts how I can get the interpreter to use MY custom stream?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080925/9371b9e3/attachment.html>

More information about the Python-list mailing list