I want to search a file for all lines containing a given string without matching case. How can I make this code case-insensitive?
with open(logfile) as inf:
for line in inf:
if var in line:
print 'found',line
I want to search a file for all lines containing a given string without matching case. How can I make this code case-insensitive?
with open(logfile) as inf:
for line in inf:
if var in line:
print 'found',line