pipe command to script

Josh Close narshe at gmail.com
Mon Sep 20 15:16:50 EDT 2004


How can I read input from stdin pipe from somewhere?

ex:
# echo hello | script.py

I was thinking opening file() or popen() with sys.stdin, but that
didn't work. I've done this before but don't have the code anymore and
can't figure it out again.

Thanks.

-Josh



More information about the Python-list mailing list