Assuming you want to know the location:
str.find(sub[, start[, end]])
Return the lowest index in the string where substring sub is found, such that sub is contained in the slice s[start:end]. Optional
arguments start and end are interpreted as in slice notation. Return
-1 if sub is not found.
If you don't care to know where the substring is located in the haystack string, just
substr in haystack
will return True or False, and that's all you want to know
Since you're already loading the entire file into memory, this seems like the best way to go. If it turns out that the file is larger than will fit in memory, or is actually a stream, then some other approach will be required. (but I don't want to get into that unless it's needed)