while True:
    line = thefile.readline()
if not line:
    time.sleep(0.1)
continue
yield line
if __name__ == '__main__':
    logfile = open('run/foo/access-log', 'r')
loglines = follow(logfile)
for line in loglines:
    pass
Reading from a frequently updated file