I am in WindowsXP. This seems to affect any process, but I will use Python3.2 to demonstrate it. A script, 'filter.py':
import sys
for line in sys.stdin:
print(line)
The launch is as follows:
echo hello | filter.py
Torn as follows:
Traceback (most recent call last):
File "F:\Documents and Settings\jhartley\docs\projects\filtercwd\filter.py", line 3, in <module>
for line in sys.stdin:
TypeError: 'NoneType' object is not iterable
Of course, adding a seal to find out the value of sys.stdin, reports that it is None (and NoneType.)
Alternatively, follow these steps:
echo hello | python filter.py
(with an explicit python call) works fine.
My .py files are connected for execution using Python using the assoc and ftype mechanism (the way Windows associates specific file name extensions that will be executed using certain programs):
> assoc .py
.py=Python.File
> ftype Python.File
Python.File="F:\Python32\python.exe" "%1" %*
( "python.exe", )
. Python. , filter.sh, cygwin bash. 'echo hello | bash filter.sh ' , ' echo hello | filter.sh ', filter.sh bash assoc ftype, '/dev/stdin: .
, "python" ? , , . - , ?