file1name = '/some/path/and/file'
file2name = '/another/path/and/another/file'
with open(file1name) as file1:
    with open(file2name) as file2:
        pass
Iterate across lines in two files simultaneously in Python