def pro(temp_line):
    test = 0
temp_line = temp_line.strip().split()
test = test + 1
return test, len(temp_line)
if __name__ == '__main__':
    with open('somefile.txt') as lines:
        pool = mp.Pool(processes=10)
tests_and_t = pool.map(pro, lines.readlines())
tests, t = zip(*test_and_t)
test = sum(tests)
изменение глобальной переменной при многопроцессорности в python