I\'m new to python and programming. I need some help with a python script. There are two files each containing email addresses (more than 5000 lines). Input file contains em
I think your issue stems from the following:
name = fd.readline()
if name[1:-1] in names:
name[1:-1]
slices each email address so that you skip the first and last characters. While it might be good in general to skip the last character (a newline '\n'
), when you load the name database in the "dfile"
with open(inputfile, 'r') as f:
names = f.readlines()
you are including newlines. So, don't slice the names in the "ifile" at all, i.e.
if name in names: