Python: Trial and error
Monday, June 20, 2016
Reading lines till eof from standard input
If you want to read lines from the standard input until End-Of-File (eof), you can use the sys.stdin, for example:
#!/usr/bin/env python3
import
sys
for
line
in
sys
.
stdin
:
print
(
line
,
end
=
""
,
flush
=
True
)
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment