Python 2.7 python sys.stdin.read不工作
这是我的密码Python 2.7 python sys.stdin.read不工作,python-2.7,Python 2.7,这是我的密码 if __name__ == '__main__': import sys text = sys.stdin.read().decode('ascii', errors='replace') print text 当我运行它时,我输入文本并按enter键,但什么也没发生,它一直在运行。怎么了? 使用Ctrl+d 或者使用input()或raw\u input() 查看文档帮助(sys.stdin.read) 使用Ctrl+d 或者使用input()或r
if __name__ == '__main__':
import sys
text = sys.stdin.read().decode('ascii', errors='replace')
print text
当我运行它时,我输入文本并按enter键,但什么也没发生,它一直在运行。怎么了?- 使用
Ctrl+d
- 或者使用
或input()
raw\u input()
- 查看文档帮助(sys.stdin.read)
- 使用
Ctrl+d
- 或者使用
或input()
raw\u input()
- 查看文档帮助(sys.stdin.read)
enter
键,然后按Ctrl+Z
。它将给出正确的结果
如需更多帮助,请访问此网站:您应该输入文本,按
enter
键,然后按Ctrl+Z
。它将给出正确的结果
有关更多帮助,请访问此网站:Ctrl-Z是Windows特有的。在真正的计算机上,尝试ctrl-D。是的,但ctrl+Z将在cmd中工作,我已经测试过了。Ctrl+D在cmd中不起作用。Ctrl-Z是特定于Windows的。在真正的计算机上,尝试ctrl-D。是的,但ctrl+Z将在cmd中工作,我已经测试过了。Ctrl+D在cmd中不起作用。