Python tail -f 处理 浏览 实时日志

import subprocess

f = subprocess.Popen(['tail', '-F', "/var/log/xferlog"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
while True:
    line = f.stdout.readline()
    print(line)

猜你喜欢

转载自blog.csdn.net/x1131230123/article/details/120536391