title: python - Reading several columns from file
body: <p>This is a derivative from <a href="https://stackoverflow.com/questions/13017130/gnuplot-histogram-with-histeps-connects-bars/13021876#comment17689622_13021876">this question</a>. In that one, the following line comes up in a <code>python</code>script:</p>
  
  <pre><code>c1,c2 = [float(x) for x in line.split()] #convert line into 2 floats and unpack
  </code></pre>
  
  <p>when reading a data file with two columns.</p>
  
  <p>Now, my <strong>real</strong> data file has 31 columns and I need to use columns 28 and 31 instead of 1 and 2. When I try the simplest (and ugliest) approach at escalating that line:</p>
  
  <pre><code>c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16,c17,c18,c19,c20,c21,c22,c23,c24,c25,c26,c27,c28,c29,c30,c31 = [float(x) for x in line.split()]
  </code></pre>
  
  <p>I get the error:</p>
  
  <pre><code>ValueError: too many values to unpack
  </code></pre>
  
  <p>How can I properly read all the columns in my file?</p>