> > Use subprocess.PIPE > Usually the tricky part is to figure out exactly whether there is more > input or not. With Python it's easy, use the ps1 prompt.
Thanks, but that is not exactly what I meant. (Maybe my question was a bit vague). I want to replace the input stream of the *remote* process. So I'll be running something like "python -i remote.py", and inside remote.py I create a pseudo-file to replace the input stream (of the remote process). I have now solved my problem by running "python remote.py" (without the -i) and start an interactive interpreter (inherited from code.InteractiveConsole). This interpreter *does* use the sys.stdin, so I can just do: "sys.stdin = my_pseudo_file" (I start a separate thread that reads the original stdin and writes received text to the pseudofile. But now I can also communicate and do stuff with the process when the main thread is running (for example interrupting it on windows!)) I would still like to hear if anyone knows how I can change the input stream that is used when running "python -i", but I would not be surprised if it is impossible... Almar
-- http://mail.python.org/mailman/listinfo/python-list