write to specific line in file?

I-T iqbaltalaat at gmail.com
Fri May 16 14:53:33 EDT 2008


Open the file inside your script in append mode.

open('filename', 'wa')


On May 16, 11:41 pm, globalrev <skanem... at yahoo.se> wrote:
> i ahve a program that takes certain textsnippets out of one file and
> inserts them into another.
>
> problem is it jsut overwrites the first riow every time.
>
> i want to insert every new piece of text into the next row.
> so:
> 1. how do i write to a new line every time i write to the file?
>
> 2. if i dont want to write to a new line but just want to insert it
> after the last token in the file, how do i do then?




More information about the Python-list mailing list