I have a file consists of many strings. Looks like
sdfsdf sdfsdfsdf sdfsdfsdf test gggg uff test test fffffffff sdgsdgsdgsdg sdgsdgsdgsdg uuuttt 5
If you want to find all matches:
with open("file") as f: numtest = f.read().count("test")
If you want to find only word matches:
with open("file") as f: numtest = f.read().split().count("test")