当我使用流重定向执行 Python 脚本时,我不断收到 EOF 错误。
脚本
name=input('Enter your name : ')
print ('Welcome ' + name)
input('Press \'ENTER\' to exit!')
执行命令:
helloworld.py < input.dat
错误:
Enter your name : Welcome Gunit
Press 'ENTER' to exit!Traceback (most recent call last):
File "D:\Reference\Python\Codes\helloworld.py", line 28, in <module>
input('Press \'ENTER\' to exit!')
EOFError: EOF when reading a line