code: def follow(self, delay=1.0):
          
          trailing = True
  
          while 1:
              where = self.file.tell()
              line = self.file.readline()
              if line:
                  if trailing and line in self.line_terminators:
                      # This is just the line terminator added to the end of the file
                      # before a new line, ignore.
                      trailing = False
                      continue
  
                  if line[-1] in self.line_terminators:
                      line = line[:-1]
                      if line[-1:] == '\r\n' and '\r\n' in self.line_terminators:
                          # found crlf
                          line = line[:-1]
  
                  trailing = False
                  yield line
              else:
                  trailing = True
                  self.seek(where)
                  time.sleep(delay)
docs: \
          Iterator generator that returns lines as data is added to the file.
  
          Based on: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/157035