标签:for 生成 用户 监听 tail def pre print open
def tail(filename): f = open(filename,encoding=‘utf-8‘) while True: line = f.readline() if line: yield line.strip() g = tail(‘file‘) for i in g: print(i)
标签:for 生成 用户 监听 tail def pre print open
原文地址:https://www.cnblogs.com/fate2048/p/9691609.html