Sending EOF (CTRL-D) to a subprocess

Grant Edwards grante at visi.com
Wed Nov 21 20:25:11 CET 2001


In article <wsky9l8wjrz.fsf at demokrit.informatik.uni-mannheim.de>, Holger Fuessler wrote:

> Can anybody tell me how to send a C-D to a subprocess opened with
> os.popen()?

If you want to send ctrl-D, then just write ctrl-D to the pipe.
However, mapping ctrl-D to EOF is something done by the tty
driver (which isn't involved in a pipe). If what you want to do
is cause an EOF, then close the pipe.

-- 
Grant Edwards                   grante             Yow!  Now that we're
                                  at               in LOVE, you can BUY
                               visi.com            this GOLDFISH for a 48%
                                                   DISCOUNT.



More information about the Python-list mailing list