Python -- Quotations around filenames
<p>I'm not quite sure when I need to put quotations around the filenames in Python.<br>
For example, when I set</p>

<pre><code>f = open(file)
</code></pre>

<p>I can run something like</p>

<pre><code>len(f.read())
</code></pre>

<p>and it will run fine.
However, when I do it directly, it only works with</p>

<pre><code>len(open("file").read())
</code></pre>

<p>Likewise, in terminal when running from Python I always have to use quotations.<br>
What is the 'rule' when using quotations?   </p>

<p>Thank you.</p>
