title: ValueError: could not convert string to float.
body: <p>I'm trying to read in a text file and turn the input into lists:</p>
  
  <pre><code>model = open('Grids/Dusty_AGN/Z'+Z+'_n'+n+'_alp-'+alpha+'_fluxes.txt','r')
  
  Hafluxfile = model.readline() + model.readline() + model.readline() ; the first three lines of the file contain the values that I need
  
  Haflux = []
  
  Haflux.append([float(x) for x in Hafluxfile.split(' ')])
  </code></pre>
  
  <p>If I <code>print Hafluxfile</code>, this is what I see:</p>
  
  <pre><code>  2.97500      2.94300      2.92700      2.91800      2.90700      2.90200
    2.89300      2.87700      2.86700      2.87000      2.89900      2.93500
    2.91900
  </code></pre>
  
  <p>and then I end up with this error message when trying to append the list <code>Haflux</code>:</p>
  
  <blockquote>
    <p>ValueError: could not convert string to float</p>
  </blockquote>
  
  <p>and no, there is nothing that I haven't included beyond the colon, it seems to be telling me that white space is preventing it from getting to the first number? I don't know how to work around this.</p>