What is the best way to parse a log file into a python list?
<p>I have an interesting log file format and I would like to parse it into Python for analysis.</p>

<p>The format is <code>key=value</code> with each separated by tabs, and a newline at the end of each entry, like this: </p>

<pre><code>date="Mon, 04 Jul 2011 05:05:45 GMT"    addr=127.0.0.1  response_time=13    method=GET  url=/   status=200  referrer=   user_agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.112 Safari/534.30"
</code></pre>

<p>Now some of the fields may be changing, so I want the code to be flexible with what is thrown at it, as long as it is in the form of <code>key=value key=value</code>(etc.)</p>

<p>As of now, I have two embedded <code>for</code> loops, one to split each line into the <code>key=value</code> fields, and the other to split the <code>key=value</code> into their own separate entities. </p>

<p>Does this seem like the best way to go or is there a more elegant solution?</p>
