How to search for a string case-insensitively without regular expressions?
<p>I want to search a file for all lines containing a given string without matching case.  How can I make this code case-insensitive?</p>

<pre class="lang-py prettyprint-override"><code>with open(logfile) as inf:
    for line in inf:
        if var in line:
            print 'found',line
</code></pre>
