On Fri, Jun 10, 2011 at 12:58 PM, Mark Phillips <[email protected]> wrote: > How do I write my script so it picks up argument from the output of commands > that pipe input into my script?
def main():
import sys
print sys.stdin.read()
if __name__ == '__main__':
main()
$ echo "fred" | python script.py
fred
$
--
http://mail.python.org/mailman/listinfo/python-list
