First line of file being skipped. Python
<p>Below is a simple search. It works, except for the fact that <code>iterator</code> is skipping the first line of the file. Inside <code>iterator</code> The first <code>print</code> statement has the correct word, but the second <code>print</code> statement (after the <code>for</code> loop) has the second line of text, not the first.</p>

<p>What about this <code>for</code> loops behavior am I missing?</p>

<pre><code>"""Searches for the query inside a file
"""
def lines(the_file, query):
    lines = open(the_file)
    line(lines, query)

def line(lines, query):
    line = lines.readline()
    iterator(line, lines, word, query)

def word(line, query):
    word = line.strip()
    conditional(query, word)

def iterator(this, that, function, query):
    print this
    for this in that:
        print this
        function(this, query)

def conditional(this, that):
    if this in that:
        output(that, True)
    else:
        None

def output(query, result):
    print query

def search(the_file, query):
    lines(the_file, query)

search('c:/py/myfile.txt', 'a')
</code></pre>
