[Tutor] Strange XP stdin behaviour.

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Sat Aug 27 02:54:40 CEST 2005


> C:\somepath> intest.py < in.txt
>
> There is no output!
> In fact, I get an error:
>
> E:\PROJECTS\Python>intest.py < in.txt
> Traceback (most recent call last):
>   File "E:\PROJECTS\Python\intest.py", line 2, in ?
>     inp = raw_input()
> EOFError: EOF when reading a line

Hi Alan,

Yes, this is a Windows-specific thing.  Unfortunately, Windows's treatment
of shell scripts is slightly inconsistant.  However, there are workarounds
by making a '.CMD' file.  See:

    http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/366355

for details.

Hope this helps!



More information about the Tutor mailing list