title: python open & memory leaks
body: <p>When is a file closed? </p>
  
  <pre><code>    # Read all data from input file
      mergeData = open( "myinput.txt","r" )
      allData = mergeData.read()
      mergeData.close()
  </code></pre>
  
  <p>Can I substitute this code?</p>
  
  <pre><code>allData = read.open( "myinput.txt","r" )
  </code></pre>
  
  <p>I was wondering when the file would be closed?  would be closed one the statement is run? or wait until the program exits.</p>