for index, line in enumerate(rofile):
    if line == 'foo':
        for a in range(index, index + HOW_MANY_LINES_YOU_WANT):
            pass
Python: For loop with files, how to grab the next line within forloop?