Is there a more efficient method to find a string in a text file then:
f=file('somefil e')
for line in f:
if 'string' in line:
print 'FOUND'
?
BTW:
does "for line in f: " read a block of line to te memory or is it
simply calls f.readline() many times?
thanks
amit
f=file('somefil e')
for line in f:
if 'string' in line:
print 'FOUND'
?
BTW:
does "for line in f: " read a block of line to te memory or is it
simply calls f.readline() many times?
thanks
amit
Comment