a basic implementation of the Unix less command in python