title: Python read file into 2d list
body: <p>I have a txt file like this:</p>
  
  <pre><code>1 3 4
  5 5 6
  </code></pre>
  
  <p>and I want to parse it elements to a tuple or a list accordingly. So far I was able to read the file line by line but the result is not what I want</p>
  
  <pre><code>    ins = open( "input.txt", "r" )
      array = []
      for line in ins:
          line = line.rstrip('\n')
          array.append( line )
      ins.close()
      print array
  </code></pre>
  
  <p>however printing the array I get</p>
  
  <pre><code>['1 3 4', '5 5 6']
  </code></pre>
  
  <p>what I want is</p>
  
  <pre><code>[[1, 3, 4], [5, 5, 6]]
  </code></pre>
  
  <p>Is there any way this can be achieved?</p>