confused about stdin

David Bear david.bear at asu.edu
Fri Oct 22 01:08:41 CEST 2004


This may be a dumb question but I'm confused.

using command line syntax pipe like this:

   cat somefile | pyscript

In my pyscript I can simply do 

   buffer = sys.stdin.read()

to get all of whatever cat sends.

However, using syntax like this:

   pyscript < somefile

I'm not sure. Does this send to stdin as well? 

And.. will it work on both unix and windows?

-- 
David Bear
phone:  480-965-8257
fax:    480-965-9189
College of Public Programs/ASU
Wilson Hall 232
Tempe, AZ 85287-0803
 "Beware the IP portfolio, everyone will be suspect of trespassing"



More information about the Python-list mailing list