2012-08-10 3 views

답변

6
with open(logfile) as fin: 
    for line in fin: 
     if var.lower() in line.lower(): # makes this case insensitive 
      print 'found', line.rstrip() # You will be printing double new lines 
             # without rstrip here 
내가 대신 부동`에서 사용되는 무한 같다 inf``의 fin``갈 것
관련 문제