Removing last line while appending to file

Peter Hansen peter at engcorp.com
Wed Apr 30 07:45:24 EDT 2003


Tim Wegener wrote:
> 
> Someone emailed me directly with the solution: use open(filename, "r+")
> This solved my problem.
> (I was using the wrong mode for open())

Maybe mode "rb+" would be a little better for you, if these needs
to be used on Windows or to be portable to Windows.

-Peter




More information about the Python-list mailing list