Python: Writing to a specific position in a text file
<p>I am writing co-ordinates to a text file, a sample data set looks as follows:</p>

<pre><code>-11.700 8.827   9.247
-11.956 8.450   7.858
-12.511 9.655   7.129
-13.527 10.173  7.584
</code></pre>

<p>The co-ordinates are arranged x,y,z respectively.</p>

<p>I need the X co-ordinates to be written to the text file where the last digit in the number fall at character position 14, the last digit in Y co-ordinates falls at character position 27 and the last digit in the Z co-ordinates falls at position 40.</p>

<p>The only way I can think of doing it, is by taking the <code>len</code> of the number and filling the space accordingly, but this seem an "ugly" way of doing this. Is there a more elegant solution?</p>
