title: Python file variable - what is it?
body: <p>I just started with Python, and since my background is in more low-level languages (java, C++), i just cant really get some things. </p>
  
  <p>So, in python one can create a file variable, by opening a text file, for example, and then iterate through its lines like this:</p>
  
  <pre><code>f = open(sys.argv[1])
  for line in f:
      #do something
  </code></pre>
  
  <p>However, if i try <code>f[0]</code> the interpreter gives an error. So what structure does <code>f</code> object have and how do i know in general, if i can apply <code>for ... in ... :</code> loop to an object?   </p>