Running python from pty without prompt

Michael Torrie torriem at
Tue Dec 13 12:12:31 EST 2016

On 12/13/2016 09:01 AM, Michael Torrie wrote:
> On 12/13/2016 05:39 AM, Samuel Williams wrote:
>> Michael, yes.
>> FYI, I found out why this works. Pressing Ctrl-D flushes the input
>> buffer. If you do this on an empty line, it causes read(...) to return
>> 0 which Ruby considers end of input for the script, but the pipe is
>> not closed.
> Currently Python does not appear to support this behavior.  Possibly it
> could be patched to support something similar, though.

I wonder if you could write a python wrapper that would read the input
file from standard in until you get a ctrl-d, then exec() that input.

More information about the Python-list mailing list