# Tailfrom __future__ import with_statementfind_str = "FIREFOX" # String to findfname = "g:/autoIt/ActiveWin.log_2" # File to checkwith open(fname, "r") as f: f.seek (0, 2)# Seek @ EOF fsize = f.tell() # Get Size f.seek (max (fsize-1024, 0), 0) # Set pos @ last n chars lines = f.readlines() # Read to endlines = lines[-10:] # Get last 10 lines# This returns True if any line is exactly find_str + "n"print find_str + "n" in lines# If you're searching for a substringfor line in lines: if find_str in line: print True break



