February 24th, 2005, 03:43 PM
Just to alleviate any doubts about this. You should have to press Ctrl-Z once to stop reading stdin and once to exit the program if
there is still work to be done, otherwise the program should get to the end and exit. You would have to press it again if for example you were inside an infinite loop.
The following program requires you to press Crtl-D once and then exits after printing what was typed.
from sys import stdin
for line in stdin:
print 'STDIN:', line,
Mark-Smiths-Computer:~ Mark$ ~/Desktop/test.py |
Hope this clears everything up,
programming language development: www.netytan.com – Hula