read_rz(输入1,输入你日志的相对目录),就会得到你日志的最近一行文件:
def read_rz(x, y): b = -1 * abs(x) a = open(y, 'rb') while True: a.seek(b, 2) c = a.readlines() if len(c) > 1: print(c[-1].decode('utf-8')) break b *= 2
本文共 303 字,大约阅读时间需要 1 分钟。
read_rz(输入1,输入你日志的相对目录),就会得到你日志的最近一行文件:
def read_rz(x, y): b = -1 * abs(x) a = open(y, 'rb') while True: a.seek(b, 2) c = a.readlines() if len(c) > 1: print(c[-1].decode('utf-8')) break b *= 2
转载于:https://www.cnblogs.com/shengbei/p/9006066.html