import os
puty = 'file1.txt'
putyfin=os.path.splitext(puty)[0]+"_finish.txt"
file_with_desired_lines = 'file2.txt'
with open(putyfin, 'w') as outfile:
with open(puty) as infile1:
with open(file_with_desired_lines) as infile2:
the_desired_lines = [''.join(line.strip().split()) for line in infile2.readlines()]
for line in infile1.readlines():
if line.split('=')[0] in the_desired_lines:
outfile.write(line)
$ uwsgi --http ... -w gorgeousrouteApp.wsgi