Re: stdin, stdout, redmon

2008-01-22 Thread Bernard Desnoues
Hello, I checked under linux and it works : text.txt : first line of the text file second line of the text file test.py : import sys a = sys.stdin.readlines() x = ''.join(a) x = x.upper() sys.stdout.write(x) cat text.txt | python test.py But I reinstalled Python 2.5 under Windows XP and it

Re: stdin, stdout, redmon

2008-01-22 Thread Tim Golden
Bernard Desnoues wrote: Hello, I checked under linux and it works : text.txt : first line of the text file second line of the text file test.py : import sys a = sys.stdin.readlines() x = ''.join(a) x = x.upper() sys.stdout.write(x) cat text.txt | python test.py But I

Re: stdin, stdout, redmon

2008-01-22 Thread John Machin
On Jan 22, 8:42 pm, Bernard Desnoues [EMAIL PROTECTED] wrote: Hello, I checked under linux and it works : text.txt : first line of the text file second line of the text file test.py : import sys a = sys.stdin.readlines() x = ''.join(a) x = x.upper() sys.stdout.write(x) cat text.txt

Re: stdin, stdout, redmon

2008-01-22 Thread Rolf van de Krol
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

Re: stdin, stdout, redmon

2008-01-22 Thread Konstantin Shaposhnikov
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)

Re: stdin, stdout, redmon

2008-01-22 Thread Konstantin Shaposhnikov
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

Re: stdin, stdout, redmon

2008-01-22 Thread Thynnus
On 1/21/2008 9:02 AM, Bernard Desnoues wrote: Hi, I've got a problem with the use of Redmon (redirection port monitor). I intend to develop a virtual printer so that I can modify data sent to the printer. FWIW: there is a nice update the RedMon (v1.7) called RedMon EE (v1.81) available

Re: stdin, stdout, redmon

2008-01-22 Thread Thynnus
On 1/22/2008 8:54 AM, Konstantin Shaposhnikov 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:

stdin, stdout, redmon

2008-01-21 Thread Bernard Desnoues
Hi, I've got a problem with the use of Redmon (redirection port monitor). I intend to develop a virtual printer so that I can modify data sent to the printer. Redmon send the data flow to the standard input and lauchs the Python program which send modified data to the standard output (Windows

Re: stdin, stdout, redmon

2008-01-21 Thread Rolf van de Krol
According to various tutorials this should work. code |import sys data = sys.stdin.readlines() print Counted, len(data), lines.| /code Please use google before asking such questions. This was found with only one search for the terms 'python read stdin' Rolf Bernard Desnoues wrote: Hi, I've

Re: stdin, stdout, redmon

2008-01-21 Thread Bernard Desnoues
Rolf van de Krol a écrit : According to various tutorials this should work. code |import sys data = sys.stdin.readlines() print Counted, len(data), lines.| /code Please use google before asking such questions. This was found with only one search for the terms 'python read stdin'

Re: stdin, stdout, redmon

2008-01-21 Thread Rolf van de Krol
I don't know what you did with your Python installation, but for me this works perfectly. test3.py contains: code import sys print sys.stdin.readlines() /code test.txt contains: code Testline1 Testline2 /code Output of 'python test3.py test.txt' is: code ['Testline1\n', 'Testline2'] /code