Sending EOF (CTRL-D) to a subprocess

Gerhard Häring gh_pythonlist at
Thu Nov 15 10:04:53 CET 2001

On Thu, Nov 15, 2001 at 08:55:12AM +0100, Holger Fuessler wrote:
> Hi all!
> Can anybody tell me how to send a C-D to a subprocess opened with
> os.popen()?

I think you mean os.popen2. Close the process' input stream, i. e. do a
.close() on the first of the two file objects os.popen2() returns.

mail:   gerhard <at> bigfoot <dot> de       registered Linux user #64239
web:    OpenPGP public key id 86AB43C0
public key fingerprint: DEC1 1D02 5743 1159 CD20  A4B6 7B22 6575 86AB 43C0
reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))

More information about the Python-list mailing list