fortmatting text python, use of floats?
<p>I am trying to format a table with values but feel i am doing it in a bad way. For instance having to convert a dictionary of ints to an int when dividing and passing into the string. And also %f seems to print loads of 0's. I just want a division with a decimal point, not all the trailing 0's</p>

<pre><code>band1= {'channel1': 10564, 'channel2': 10589, 'channel3': 10612, 'channel4': 10637,'channel5': 10662, 'channel6': 10687,
'channel7': 10712, 'channel8': 10737, 'channel9': 10762, 'channel10': 10787,'channel11': 10812, 'channel12': 10837, }


print '%10s %10s %10s %10s %10s %10s %10s %10s %10s %10s %10s %10s' % ("Channel 1", "Channel 2", "Channel 3",
"Channel 4", "Channel 5", "Channel 6", "Channel 7","Channel 8", "Channel 9", "Channel 10", "Channel 11", "Channel 12")
print '%10s %10s %10s %10s %10s %10s %10s %10s %10s %10s %10s %10s' % (band1['channel1'], band1['channel2'], band1['channel3'],
band1['channel4'], band1['channel5'], band1['channel6'], band1['channel7'], band1['channel8'], band1['channel9'], 
band1['channel10'], band1['channel11'], band1['channel12'])
print '%5f %5f %5f %5f %5f %5f %5f %5f %5f %5f %5f %5f' % (int(band1['channel1'])/5.0, int(band1['channel2'])/5.0, int(band1['channel3'])/5.0,
int(band1['channel4'])/5.0, int(band1['channel5'])/5.0, int(band1['channel6'])/5.0, int(band1['channel7'])/5.0, int(band1['channel8'])/5.0, int(band1['channel9'])/5.0, 
int(band1['channel10'])/5.0, int(band1['channel11'])/5.0, int(band1['channel12'])/5.0)
</code></pre>

<p>This gives:</p>

<pre><code>Channel 1  Channel 2  Channel 3  Channel 4  Channel 5  Channel 6  Channel 7  Channel 8  Channel 9 Channel 10 Channel 11 Channel 12
    10564      10589      10612      10637      10662      10687      10712      10737      10762      10787      10812      10837
2112.800000 2117.800000 2122.400000 2127.400000 2132.400000 2137.400000 2142.400000 2147.400000 2152.400000 2157.400000 2162.400000 2167.400000
</code></pre>
