Piping data into Python on the command line - Windows 2000

JanC usenet_spam at janc.invalid
Thu Jun 26 00:45:24 EDT 2003


David Bolen <db3l at fitlinxx.com> schreef:

> I don't know if you're saying you have a problem with Komodo, or just
> during your specific tests, but the above case (presuming that you're
> running this from a standard Windows command, cmd.exe) is a bug in
> Windows cmd.exe.  When trying to use I/O redirection and registered
> file extensions to automatically find an executable, the redirection
> doesn't work properly.  If you change this command to:
> 
> dir | python readFromStdin.py
> 
> it should work (replace "python" with the full path to your python.exe
> if it isn't in your path).

I don't know if this is a bug in cmd.exe, but at least command.com on Win9x 
does know nothing about "registered extensions" unless you use the "start" 
command.

dir | start readFromStdin.py

This works but "start" opens a new window that is closed when the script 
exits (you don't get the time to read the output).

-- 
JanC

"Be strict when sending and tolerant when receiving."
RFC 1958 - Architectural Principles of the Internet - section 3.9




More information about the Python-list mailing list