Python piping on Windows: Why does this not work?
问题 I'm trying something like this Output.py print "Hello" Input.py greeting = raw_input("Give me the greeting. ") print "The greeting is:", greeting At the cmd line Output.py | Input.py But it returns an EOFError . Can someone tell me what I am doing wrong? Thanks for your help. EDIT Patrick Harrington solution works but I don't know why... 回答1: I tested this on my Windows machine and it works if you specify the Python exe: C:\>C:\Python25\python.exe output.py | C:\Python25\python.exe input.py