title: Optimizing python input loop
body: <p>So I'm building a log parser, which uses regular expressions, and am parsing data from stdin.  I'd like the first line (the head, if you will) to go through my log detector algorithm, which tests regex.search(es) from various patterns, but I don't want to do that for every single input line.  </p>
  
  <p>I can do typical logic such as: </p>
  
  <pre><code>        First = True
          for inputLine in file:
              if First:
                  if testLogType1(inputLine):
                      print "appears to be log 1"
                  elif testLogType2(inputLine):
                      print "appears to be log 2"
                  First = False
              else:
                 pass
  </code></pre>
  
  <p>There has to be a cleaner, more pythonic way of doing this?  I'm not new to programming, but I am new to Python (rank beginner).  I can bludgeon my way through things in the Java, C++ ways of old, but I'm trying to be better.  Any thoughts on how to improve this?  </p>
  
  <p><a href="https://stackoverflow.com/questions/1927544/for-loop-first-iteration">&quot;For&quot; loop first iteration</a> is one possible way of addressing this.  Perhaps my question here is how do I adapt that answer to a once-through reading of standard input? </p>