sum file :\pp \system\streamstype data txt python adder py sum type output :\pp \system\streamstype writer py for data in ( )print('% ddatac:\pp \system\streamspython writer py python sorter py sort py output :\pp \system\streamswriter py sorter py same output as prior command on windows shorter form :\pp \system\streamspython writer py python sorter py python adder py the last command here connects three python scripts by standard streams--the output of each prior script is fed to the input of the next via pipeline shell syntax coding alternatives for adders and sorters few coding pointers hereif you look closelyyou'll notice that sorter py reads all of stdin at once with the readlines methodbut adder py reads one line at time if the input source is another programsome platforms run programs connected by pipes in parallel on such systemsreading line by line works better if the data streams being passed are largebecause readers don' have to wait until writers are completely finished to get busy processing data because input just reads stdinthe line-by-line scheme used by adder py can always be coded with manual sys stdin reads tooc:\pp \system\streamstype adder py import sys sum while trueline sys stdin readline(if not linebreak sum +int(lineprint(sumthis version utilizes the fact that int allows the digits to be surrounded by whitespace (readline returns line including its \nbut we don' have to use [:- or rstrip(to remove it for intin factwe can use python' more recent file iterators to achieve the same effect--the for loopfor exampleautomatically grabs one line each time through when we iterate over file object directly (more on file iterators in the next :\pp \system\streamstype adder py import sys sum script execution context