Appending/inserting in outfile.write()

Doug Stanfield DOUGS at oceanic.com
Mon Feb 28 16:19:30 EST 2000


A simple text file may not be the best choice for persistant storage in your
case.  Look at the shelve module for one alternative.

-Doug-

> -----Original Message-----
> From: Will [mailto:wcohen at interpath.com]
> Sent: Monday, February 28, 2000 10:46 AM
> To: python-list at python.org
> Subject: Appending/inserting in outfile.write()
> 
> 
> I'm trying to write a CGI Python guestbook.  Would there be a 
> way for me
> to get the script to simply append, say 14 bytes from the end, to the
> HTML guestbook file rather than completely overwriting it and holding
> only one entry?  I can use outfile.write to simply rewrite the entire
> file.  Do I need to use another function or just set a flag?  
> If I can't
> insert text, can i just delete the last 14 bytes and rewrite the end
> from there?
> 
> Thanks,
> Will
> -- 
> http://www.python.org/mailman/listinfo/python-list
> 




More information about the Python-list mailing list