appending a file

Gregoire Welraeds greg at perceval.be
Thu Mar 16 03:37:59 EST 2000


In reply to the message of Remco Gerlich sent on Mar 14 (see below) :

> open(filename, 'a')
> 
> 'a' for append. I'm sure it's in those books you named as well, but it's also
> in the output of "print open.__doc__".

It's in the beginning of the library reference... In the section talking
about the open function.



--
Life is not fair
But the root password helps
--

Gregoire Welraeds
greg at perceval.be
Perceval Development team
-------------------------------------------------------------------------------
Perceval Technologies sa/nv	Tel: +32-2-6409194		
Rue Tenbosch, 9			Fax: +32-2-6403154		
B-1000 Brussels			general information:   info at perceval.net
BELGIUM				technical information: helpdesk at perceval.net
URL: http://www.perceval.be/
-------------------------------------------------------------------------------

On 14 Mar 2000, Remco Gerlich wrote:

> Date: 14 Mar 2000 18:02:24 GMT
> From: Remco Gerlich <scarblac-spamtrap at pino.selwerd.nl>
> Reply-To: scarblac-rt at pino.selwerd.nl
> To: python-list at python.org
> Newsgroups: comp.lang.python
> Subject: Re: appending a file
> 
> Lenny Self wrote in comp.lang.python:
> > Hello.
> > 
> > I am a little frustrated. After looking all over the place ( Learning
> > Python, the Python Pocket Reference, Library Reference) I have been unable
> > to find how to append to the end of an existing text file using python in
> > any way other than reading the entire contents of the file out to a list,
> > adding the additional information, and then writing it all back to the
> > original file.  I know there must  be a better way to do this; for the life
> > of me, however, I seem to me unable to find it.
> > 
> > Can anyone help me out?
> 
> open(filename, 'a')
> 
> 'a' for append. I'm sure it's in those books you named as well, but it's also
> in the output of "print open.__doc__".
> 
> -- 
> Remco Gerlich,  scarblac at pino.selwerd.nl
> 
>    This is no way to be
>      Man ought to be free      -- Ted Bundy
>        That man should be me
> -- 
> http://www.python.org/mailman/listinfo/python-list
> 
> 





More information about the Python-list mailing list