Sorry, I meant: Alternatively you can use following command
cat file | python script.py instead of cat file | script.py On Jan 22, 1:54 pm, Konstantin Shaposhnikov <[EMAIL PROTECTED]> wrote: > Hi, > > This is Windows bug that is described > here:http://support.microsoft.com/default.aspx?kbid=321788 > > This article also contains solution: you need to add registry value: > > HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies > \Explorer > InheritConsoleHandles = 1 (REG_DWORD type) > > Do not forget to launch new console (cmd.exe) after editing registry. > > Alternatively you can use following command > > cat file | python script.py > > instead of > > cat file | python script.py > > Regards, > Konstantin > > On Jan 22, 1:02 pm, Rolf van de Krol <[EMAIL PROTECTED]> wrote: > > > Well, that's at least weird. I did test my code with Python 2.5 on Win > > XP, using the command prompt. But testing it with IDLE gives exactly the > > same error Bernard has. So apparently STDIN can't be accessed with IDLE. > > > Rolf > > > John Machin wrote: > > > > Excuse me, gentlemen, may I be your referee *before* you resort to > > > pistols at dawn? > > > > ===== IDLE ===== > > > IDLE 1.2.1 > > > >>>> import sys > > >>>> sys.stdin.readlines > > > > Traceback (most recent call last): > > > File "<pyshell#1>", line 1, in <module> > > > sys.stdin.readlines > > > AttributeError: readlines > > > > ===== Command Prompt ===== > > > C:\junk>python > > > Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit > > > (Intel)] on win32 > > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>> import sys > > >>>> sys.stdin.readlines > > > > <built-in method readlines of file object at 0x00B1F020> > > > > HTH, > > > John -- http://mail.python.org/mailman/listinfo/python-list