May-06-2021, 09:29 AM
There is also built-in mmap which can be used to search text inside file:
import mmap with open('my_file') as f: mapping = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ) if mapping.find(b'latest') != -1: print("Found 'latest'")It can be easily written as function and called on files needed.
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.