Read files in python
<p>Python learner. So please excuse me.
I am following: <a href="http://docs.python.org/2/tutorial/inputoutput.html#reading-and-writing-files" rel="nofollow">http://docs.python.org/2/tutorial/inputoutput.html#reading-and-writing-files</a></p>

<p>I want to read a file; here is my file:</p>

<pre><code># cat test 
line1 word1
line2 word2
line3 word3
line4 word4
</code></pre>

<p>and here it my code:</p>

<pre><code>&gt;&gt;&gt; f = open ('test')
&gt;&gt;&gt; for line in f:
...     print f
... 
&lt;open file 'test', mode 'r' at 0xb7729180&gt;
&lt;open file 'test', mode 'r' at 0xb7729180&gt;
&lt;open file 'test', mode 'r' at 0xb7729180&gt;
&lt;open file 'test', mode 'r' at 0xb7729180&gt;
</code></pre>

<p>How and why i am getting above output? I was hoping that it will print each line per line. 
What am I missing here. looking at the link mentioned above, my syntax seems to be OK but the output is not </p>

<p>Thanks.</p>
