Reading 2d arraya from a file into python list
<p>I am trying to read a 2d array of comma separated values from a file into a list. I have the following problem, how do I get rid of trailing newlines? This is what I mean. This is one row I have read.</p>

<pre><code>['0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '1', '1\n']
</code></pre>

<p>Presently, I have the following in code:</p>

<pre><code>ins = open( "parseTable.txt", "r" )
parseTable = []
for line in ins:
    row = line.split(',')
    parseTable.append(row)
</code></pre>

<p>Thanks everybody for the tips. I did the following to make do.
thanks for all the tips. I did the following to make do.</p>

<pre><code>ins = open( "parseTable.txt", "r" )
parseTable = []
for line in ins:
    row = line.split(',')
    parseTable.append(map(int,line.split(',')))
</code></pre>
