4 Input and Output of Text

The example in Section 3.2 resulted in a very inefficient program: reading the entire file to a list and processing it afterwards is extremely memory consuming.

A far better solution is to process the file incrementally line by line. This pattern of reading files occurs in fact very often, thus we provide support for it. The support provided is a mixin class Open.text. This mixin class can be used together with files, sockets, and pipes.



Christian Schulte
Version 1.4.0 (20080702)