adding string at the end of the file python
<p>Clarification:
So if my file has 10 lines:
THe first line is a heading, so I want to append some text at the end of first line</p>

<p>THen I have a list which contains 9 elements..</p>

<p>I want to read that list and append the end of each line with corresponding element..</p>

<p>So basically list[0] to second line, list[1] to third line and so on..</p>

<hr>

<p>I have a file which is delimted by comma.
something like this:</p>

<pre><code>A,B,C
0.123,222,942
......
</code></pre>

<p>Now I want to do something like this:</p>

<pre><code>A,B,C,D #append "D" just once
0.123,222,942,99293
............   
</code></pre>

<p>This "D" is actually saved in a list so yeah I have this "D"
How do I do this? I mean I know the naive way.
like go thru each line and do something like</p>

<pre><code>string += str(list[i])
</code></pre>

<p>Basically how do i append something at the end of the file in pythonic way :)</p>
