--- [EMAIL PROTECTED] wrote:

> In short, how might I go about deleting just the contents of a file?
> I tried several methods with my limited knowledge but had no luck.

I suppose the simplest thing to do would be to write an empty string to
the file:

>>> f = open('tmpfile.txt', 'w')
>>> f.write('')
>>> f.close()   # or f.flush(), if keeping open

HTH

 

John Ridley

Send instant messages to your online friends http://uk.messenger.yahoo.com 
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to