helphelpi' being repressed :\pp \system\streamspython writer py python reader py got this"helphelpi' being repressed!the meaning of life is this timetwo python programs are connected script reader gets input from script writerboth scripts simply read and writeoblivious to stream mechanics in practicesuch chaining of programs is simple form of cross-program communications it makes it easy to reuse utilities written to communicate via stdin and stdout in ways we never anticipated for instancea python program that sorts stdin text could be applied to any data source we likeincluding the output of other scripts consider the python command-line utility scripts in examples - and - which sort and sum lines in the standard input stream example - pp \system\streams\sorter py import sys lines sys stdin readlines(lines sort(for line in linesprint(lineend=''or sorted(sys stdinsort stdin input linessend result to stdout for further processing example - pp \system\streams\adder py import sys sum while truetryline input(except eoferrorbreak elsesum +int(lineprint(sumor call sys stdin readlines(or for line in sys stdininput strips \ at end was sting atoi(in nd ed we can apply such general-purpose tools in variety of ways at the shell command line to sort and sum arbitrary files and program outputs (windows noteon my prior xp machine and python xi had to type "python file pyherenot just "file py,or else the input redirection failedwith python on windows todayeither form works) :\pp \system\streamstype data txt :\pp \system\streamspython sorter py data txt sort file standard streams