What exactly do you want to achieve? Matching a whole word or replace one with another.
with open('C:/Temp/Substitutions.txt') as f: for line in f: if word in line.lower(): # lower is an option here if you want case insensitive matching # do something