title: python read file operation
body: <p>I am trying to read numbers from a file in python. The file contains ONLY numbers. ALl numbers are decimal!!
  As asked, this is the file contents:
  25
  4
  2
  6
  7</p>
  
  <p>I get this error:</p>
  
  <pre><code>Traceback (most recent call last):
      File "readfile.py", line 18, in &lt;module&gt;
      a.append(int(data[i]))
  ValueError: invalid literal for int() with base 10: 'f'"
  </code></pre>
  
  <p>This is my code:</p>
  
  <pre><code>check=0
  while(check!=1):
      file=raw_input("Plase state the file name:")
      print "\n"
      try:
              check=1
              fo=open(file,"r",1)
      except IOError:
              print "NO such file or directory"
              check=0
  
  data=0
  a=[]
  i=0
  for line in file:
      data=line.split()
      print data
      a.append(int(data[i]))
      i=i+1
  print a
  
  fo.close()
  </code></pre>