code: def readlines(self, offset=0):
          
          try:
              with open(self._filepath) as fp:
                  # For full read go through existing lines in file
                  if self._full_read:
                      fp.seek(offset)
                      for row in fp:
                          yield row
  
                  # Okay now dynamically tail the file
                  if self._tail:
                      while True:
                          current = fp.tell()
                          row = fp.readline()
                          if row:
                              yield row
                          else:
                              fp.seek(current)
                              time.sleep(self._sleep)
  
          except IOError as err:
              print('Error reading the file {0}: {1}'.format(self._filepath, err))
              return
docs: Open the file for reading and yield lines as they are added