title: Python Print each line of text file into list without \n
body: <p>I'm still new to learning python and was just wondering how to store each line of a text file into a list without the \n appearing.
  I've tried:</p>
  <pre><code>file = open(&quot;test_file.txt&quot;, &quot;r&quot;)
  table = [line.split(') for line in file.readlines()]
  </code></pre>
  <p>Outputs:</p>
  <pre><code>[['Beans', ' 1222', ' 422', ' 6712\n'], ['Eggs', ' 4423', ' 122', ' 2231\n'], ['Tomato', ' 2232', ' 224', ' 2321']]
  </code></pre>
  <p>Desired output:</p>
  <pre><code>[['Beans', '1222', '422', '6712], ['Eggs', '4223', '122', '2231'], ['Tomato', '2232', '224', '2321']]
  </code></pre>
  <p>I've tried <code>temp = file.read().splitlines()</code> but it ends up storing it all into one list<code>['Beans, 1222, 422, 6712', 'Eggs, 4423, 122, 2231', 'Tomato, 2232, 224, 2321'] </code> when I still want each line to be a list itself.
  Any help greatly appreciated!!</p>