def run_tail(filename):
    '''run tail -f on file, returns tails's PID'''
    if not os.path.exists(filename):
        return None

    process = subprocess.Popen(['tail', '-f', filename], bufsize=1)
    return process.pid
run tail -f on file, returns tails's PID
recipes/Python/577398_tail_f_with_inode_monitor/recipe-577398.py