File IO Issues, help :(

Peter Otten __peter__ at web.de
Wed Apr 30 06:17:08 EDT 2008


Dennis Lee Bieber wrote:

> On Tue, 29 Apr 2008 08:35:46 +0200, Peter Otten <__peter__ at web.de>
> declaimed the following in comp.lang.python:
> 
> 
>> jsfile.truncate(0)
>> jsfile.seek(0)
>>
> I'd suggest first doing the seek to start, then do the truncate

I usually overwrite the file, and that shows. Is there a usecase where
truncate() with an argument actually makes sense?

Peter



More information about the Python-list mailing list