title: python parse file
body: <p>I have a file with username and emails, in this format :</p>
  
  <pre><code>pete,pbellyer@gmail.com
  </code></pre>
  
  <p>I want to only keep the email, so i thought about using a regex like this :</p>
  
  <pre><code>import re,sys
  
  Mailfile = sys.argv[1]
  
  file = open(Mailfile, "r")
  
  for MAIL in file.readlines():
     tmp = re.split("\n+", MAIL)
     m = re.match( ',(.+)', MAIL)
     m.group(0)
  </code></pre>
  
  <p>But then I don't know how to store the result in a file.
  I always get the last email address in the new file.</p>
  
  <p>What would be the best way to store the results in a file ?
  Thanks!</p>