title: How to read numbers in text file using python?
body: <p>I am new to python programming and I am learning python by doing simple programs. Here is what I would like to do: if I have a text file containing numbers:
  say this a f1.txt</p>
  
  <pre><code>f1.txt:
  
  1 2 3 4
  5 6 7 8
  9 10 11 12
  13 14 15 15
  
  
  fp = open('f1.txt')
  a1=[]
  a2=[]
  a3=[]
  a4=[]
  lines = fp.readlines()
  
  for ln in lines[0:len(lines)]:
  line=ln.strip().split()
  a1=line();
  
  fp.close()
  </code></pre>
  
  <p>I want to get first column in a1, second in a2 and so on. I know above code may be wrong, please tell me where I went wrong and how to correct it. Especially I am not understanding command 'ln.strip().split()'. Can someone help?</p>