How to merge data in a existant file

Oleg Broytmann phd at sun.med.ru
Mon Apr 19 05:56:02 EDT 1999


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.





More information about the Python-list mailing list