I want to search and match a particular word in a text file.
with open(\'wordlist.txt\', \'r\') as searchfile: for line in searchfile: if
You ought to use a regular expression. The regular expression howto from the Python docs might be a good place to start.