[Tutor] Unix philosophy

Alan Gauld alan.gauld at blueyonder.co.uk
Tue Nov 18 13:01:01 EST 2003


> def process (input, output):
>     for line in input:
>         ...
> output.write(line)
>  
> if __name__ ==  '__main__':
>     import sys
>     # (Or process command-line arguments to specify files...)
>     process(sys.stdin, sys.stdout)


Hmm, do we have an old Pascal programmer in our midst? 

program(input, output)
begin
   readln(input);
   writeln(output)
end.

;-)

Alan G.



More information about the Tutor mailing list