title: python close file descriptor question
body: <p>I think this question is more of a "coding style" rather than technical issue.</p>
  
  <p>Said I have a line of code:</p>
  
  <pre><code>buf = open('test.txt','r').readlines()
  ...
  </code></pre>
  
  <p>Will the file descriptor automatically close, or will it stay in the memory?
  If the file descriptor is not closed, what is the prefer way to close it? </p>