title: File open and close in python
body: <p>I have read that when file is opened using the below format </p>
  
  <pre><code>with open(filename) as f:
         #My Code
  f.close()
  </code></pre>
  
  <p>explicit closing of file is not required . Can someone explain why is it so ? Also if someone does explicitly close the file, will it have any undesirable effect ?</p>