How do i just read the last line, while a file is getting updated? I saw solution which waited for one second to read again. But i want to run a function each time a line is added if the line contains a chasephrase? How do i do that? I tried the following
f1 = open('file.txt', 'r')
while True:
for line in f1:
pass
print(line)
which prints me the last line constantly. How do i implement this functionality while it only do something (print in the moment) once a new line is added and only once?