, , . ctrl-D, enter. , enter. ctrl-D, enter, ctrl-D, . ( ctrl-D ) .
, , Python script a.py:
import sys
for line in sys.stdin:
sys.stdout.write('%s' % line)
:
$ python a.py
:
line 1
line 2<ctrl-D><ctrl-D>
:
line 1
line 2$
$ - . :
$python a.py
1
2 line1
2 $
( Bold shows the output of the program. Roman-case is intended to display what I typed, without two ctrl-Ds)
If this is not what is happening, you need to tell us more about what you are doing.
source
share