[Zope] Appending to a file in Python

Laura McCord Laura.McCord at doucet-austin.com
Thu May 20 12:57:11 EDT 2004

Oh, I had seen the append function being used in some examples through
my google search. So I assumed that append was a built-in function. 

Thanks, I'll try write()


-----Original Message-----
From: zope-bounces at zope.org [mailto:zope-bounces at zope.org] On Behalf Of
Paul Winkler
Sent: Thursday, May 20, 2004 11:51 AM
To: zope at zope.org
Subject: Re: [Zope] Appending to a file in Python

On Thu, May 20, 2004 at 11:36:36AM -0500, Laura McCord wrote:
> I have been getting an error : 'file' object has no attribute 'append'

That's because python file objects really do not have an 
append method :-) Try the write method instead.
It's good to get familiar with the Python docs, particularly the
standard library reference: http://docs.python.org/lib/lib.html
In this case, under "built-in types", you will find this:


Paul Winkler

Zope maillist  -  Zope at zope.org
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-dev )

More information about the Zope mailing list