From: phd at sun.med.ru (Oleg Broytmann)
Date: Mon, 19 Apr 1999 09:56:02 GMT
Subject: How to merge data in a existant file
In-Reply-To: <7feqbf$pr6$1@nnrp1.dejanews.com>
References: <7feqbf$pr6$1@nnrp1.dejanews.com>
Message-ID: <Pine.SOL2.3.96.SK.990419135336.9569O-100000@sun.med.ru>
X-UID: 573                                                  

Hi!

On Mon, 19 Apr 1999 fquiquet at lemel.fr wrote:
> I know how to write data in a new file :
> 
> f=open('file.name','w')
> f.write('data')
> f.close()
> 
> I don't know what is the function that permit to add data whithout erase
> existing data.

f=open('file.name', 'a')
                     ^ append
   Other file modes are 'r+' and 'w+'. Read python documenataion on file
modes and open(). Remember to use 'b' when working with binary files
(mode = 'rb', for example.)

> Thank's for your response to fquiquet at lemel.fr

Oleg.
---- 
    Oleg Broytmann  National Research Surgery Centre  http://sun.med.ru/~phd/
           Programmers don't die, they just GOSUB without RETURN.





