Reputation: 363
This is my code
if __name__ == '__main__':
import sys
text = sys.stdin.read().decode('ascii', errors='replace')
print text
When I run it, I enter the text and press enter, but nothing happens and it keeps running forever. What is wrong ?
Upvotes: 0
Views: 4826
Reputation: 468
You should enter the text, press the Enter
key, then press Ctrl + Z
. It will give the correct result.
For more help, please visit this: https://bugs.python.org/issue5505
Upvotes: 0
Reputation: 1691
Ctrl+d
input()
or raw_input()
>>> help(sys.stdin.read)
Upvotes: 2