Is there a way to search a specific word in python, like 'or'. I did this:
word = raw_input("what do you want to search? ")
for filee in open('text.txt'):
if word in filee:
print "found"
But it looks for the string 'or'. For example; if the word 'world' exists in text.txt or some other word containing the 'or' string it prints "found"
Is there a way to search only for that specific word 'or' ?
Use
regex
with word boundaries: