title: .write not working in Python
body: <p>I'm fairly new to Python so hopefully I'm just missing something obvious here, but it has me stumped.  Snippet of my program below:</p>
  
  <pre><code>outFile = open('P4Output.txt', 'w')
  outFile.write(output)
  print output
  print "Output saved to \"P4Output.txt\"\n"
  </code></pre>
  
  <p>output prints correctly to the console, but if I go open up the file it's blank.  If I delete the file and execute my program again, the file is created but still is empty.  I used this exact same block of code in another program of mine previously and it worked, and still works.  However, if I open up Python and try something simple like:</p>
  
  <pre><code>f = open('test.txt', 'w')
  f.write("test")
  </code></pre>
  
  <p>Again, test.txt is created but is left blank.  What gives?</p>