A python implementation of GNU tail and head - forked from google code rev#3