There is such a code that counts data from the entire log file (the log file is constantly updated), and writes only the result of the sum of the last count into a variable.
import re import operator last = operator.itemgetter(-1) a = open('14.04.2019.log', 'r') while a: for i in a: res = re.findall(r': (\d+) \+ (\d+)$', i) if res: a_list = [(sum(map(int, *res)))] b = last(a_list) how to implement the print variable when it changes, that is, with each change, a number was output. And in the end it turned out for example
123 6869 457 235
vunder the vote count - Sergey Nudnov