Ctrl+ Dhas a weird effect. It does not close the input stream, but only causes the C-level to fread()return an empty result. For regular files, this result means that the file is at its end, but it is acceptable to read more, for example. to check if someone has added more data to the file.
, - !
, , , , - Ctrl + D, :
import sys
while True:
line = sys.stdin.readline()
print repr(line)
'\n', , "" Ctrl + D, '' ( , , , if line == '': break).