>>> a = [('1', 'a', 'b', 'c'), ('2', 'x', 'y', 'z'), ('3', 'x', 'y', 'z')]
>>> b = [('a', 'b', 'c', 'd'), ('x', 'y', 'z', 'w'), ('x', 'y', 'z', 'w'), ('u', 'o', 'n', 'm')]
>>> new_list = lambda x, y: [i for i in x] + [i for i in y if i not in x]
>>> new_result = list(map(new_list, a, b))
>>> new_result
[['1', 'a', 'b', 'c', 'd'], ['2', 'x', 'y', 'z', 'w'], ['3', 'x', 'y', 'z', 'w']]
dictionary = {}
with open('filename', 'r', encoding="utf-8") as f:
for l in f:
dictionary[l.strip()] = ''
а то у nginx с php очень плохоС каких это пор?