title: Python print floats padded with spaces instead of zeros
body: <p>I have a float <code>myfloat = 0.002</code> I want to print with space padding <code>' '</code> instead of trailing zeros.</p>
  
  <p>Let's say I want to print <code>myfloat</code> with space-padding right-justified to 5 spaces. For clarity I will print <code>'|'</code> after my float.</p>
  
  <p>What I want:
  <code>0.002  |</code></p>
  
  <p>What padded printing (I know of) gives:</p>
  
  <pre><code>&gt;&gt;&gt; print(str(myfloat) + '|') # no padding, formatting
  0.002|
  &gt;&gt;&gt; print('%.5f' % myfloat + '|') 
  0.00200|
  &gt;&gt;&gt; print('{0:&lt;5f}|'.format(myfloat))
  0.002000|
  &gt;&gt;&gt; print('{0:.5f}|'.format(myfloat)) 
  0.00200|
  </code></pre>
  
  <p>I know <code>print('{0:&lt;Xf}|'.format(myfloat))</code> pads with spaces after X > 8 or so. I do not want any trailing zeros. </p>
  
  <p>I am printing multiple floats on the same line. They have varying string lengths and I want them evenly justified with space padding rather than zeros, so a static padding string will not work.</p>
  
  <p>For instance, lets say I want to print the contents of <code>myfloatlist1 = [0.01, 0.002, 0.0003, 0.00004]</code> and <code>myfloatlist2 = [0.00004, 0.0003, 0.002, 0.01]</code>on a two lines, each with the same spaced padding:</p>
  
  <pre><code>0.01     0.002    0.0003   0.00004 
  0.00004  0.0003   0.002    0.01
  </code></pre>
  
  <p>Is there anyway to pad float prints with spaces (without converting the float to a string or something)? </p>