Writing multiple lines to a file

Quinn Dunkan quinn at myxo.ugcs.caltech.edu
Sat Jan 29 15:54:17 EST 2000


On 29 Jan 2000 21:34:15 +0100, Martin Skøtt <mskott at image.dk> wrote:
>The line gets written to the file but if I run the program again the
>line generated in the previous run gets overwritten? I dont want that,
>I want the program to append my string to the file without touching
>other lines. Can you help me.
>I am sorry if this is a FAQ but i'm all new to Python.

See the open() documentation.  In short:
fp = open('file', 'a')



More information about the Python-list mailing list