with open (name,"rb") as f need not close am i right?
<p>I notice that I can open a file like this:</p>

<pre><code>f=open("a.dat","rb")
</code></pre>

<p>And another method:</p>

<pre><code>with open("a.dat","rb") as f:
</code></pre>

<p>In my opinion, if I use the first one, I must call f.close() function, while the second method need not. Am I right? Or there would be better method? Which one is the best to open a file in python? Thanks;-)</p>
