def tailf(filename):
 file = open(filename, 'r')
 st_results = os.stat(filename)
 st_size = st_results[6]
 file.seek(st_size)
 while True:
  where = file.tell()
  line = file.readline()
  if (not line):
   time.sleep(1)
   file.seek(where)
   continue
  print line,

def tailf ( filename ) : file = open ( filename , 'r' ) st_results = os . stat ( filename ) st_size = st_results [ 6 ] file . seek ( st_size ) while True : where = file . tell ( ) line = file . readline ( ) if ( not line ) : time . sleep ( 1 ) file . seek ( where ) continue print line ,
constantly displays the last lines in filename similar to tail -f unix command .