python 3a search file for string

Solutions on MaxInterview for python 3a search file for string by the best coders in the world

showing results for - "python 3a search file for string"
Hadrien
13 Jan 2020
1import mmap
2
3with open('example.txt') as f:
4    s = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)
5    if s.find('blabla') != -1:
6        print('true')
7
similar questions
queries leading to this page
python 3a search file for string