Answers for "python : search file for string"

0

python : search file for string

import mmap

with open('example.txt') as f:
    s = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)
    if s.find('blabla') != -1:
        print('true')
Posted by: Guest on September-25-2021

Code answers related to "python : search file for string"

Python Answers by Framework

Browse Popular Code Answers by Language