Problems with file.write()

Marc mnations at airmail.net
Fri Aug 30 11:31:34 EDT 2002


> Sounds like a buffering problem. Try f.flush() or opening the file with
> a different buffering mode e.g. open('filename', 'w', 1)

I changed the buffering mode when I opened the file, and it definitely
helped. Now I get almost the whole file, everything except for the
last three or four lines. So I guess I do have some type of buffering
problem. I don't understand why this happens though. I've never had
this problem before, and I've worked quite a bit with files.

So now how do I get those last few lines? And if I should place a
strategic .flush() somewhere, where should it go?

Thanks again,
Marc



More information about the Python-list mailing list