Zaimplementuj polecenie tail


In [ ]:
from collections import deque

def tail(path, maxlen=5):
    result = None
    with open(path, "r") as f:
        result = deque(f, maxlen)
    yield from result

for el in tail("test.xml"):
    print(el)