Directed input

Steve Holden sholden at
Tue Oct 16 23:31:19 CEST 2001

"Kragen Sitaker" <kragen at> wrote in message
news:BR0z7.1417$Z2.283368 at
> In article <9qi4r2$gpq$1 at>,
> Michael Yuen <myuen at> wrote:
> >I'm just in the process of learning Python right now and i'm wondering if
> >there's a way run a program to take a file via directed input and
> >sending output to another file via the command line.
> >
> >Here's what I mean:
> >
> > < my_input > my_output
> I assume you're on Unix?  The above should work fine.

If, however, you are on Windows NT, you will find that a bug in the command
processor (NT's, that is) stops redirection from working on commands where
the executable is deduced from a file extension. Therefore in this
environment you need:

python < my_input > my_output

This is also required on Win95/98 (except cygwin/bash, which is pretty
Unix-like on all Windows flavors).


More information about the Python-list mailing list