title: Python Save to file
body: <p>I would like to save a string to a file with a python program named <code>Failed.py</code></p>
  
  <p>Here is what I have so far:</p>
  
  <pre><code>myFile = open('today','r')
  
  ips = {}
  
  for line in myFile:
      parts = line.split(' ')
      if parts[1] == 'Failure':
          if parts[0] in ips:
              ips[pars[0]] += 1
          else:
              ips[parts[0]] = 0
  
  for ip in [k for k, v in ips.iteritems() if v &gt;=5]:
      #write to file called Failed.py
  </code></pre>