find_str = 'ERROR'
error = False
with open(file_directory, 'rb') as file:
    file.seek(-1024 * 1024, os.SEEK_END)
if find_str in file.read():
    error = True
How to read the last MB of a very large text file