Have a name/value collection, want to write it out to a file
<p>I have a name/value collection like this:</p>

<pre><code>for k,v in sorted(userlist):
    print k, v
</code></pre>

<p>How can I write this out to a file, having each key on a single line, and I want it to overright anything if the file exists.</p>

<p>I will then modify the file by hand, and then I want to read the file back into the dictionary.</p>

<p>sorry new to this kinda.</p>
