Re: Deleting or Empty a File

2007-04-17 Thread Tim Golden
Robert Rawlins - Think Blue wrote: > I'm looking to clear those log files we were discussing earlier chaps, > > What the best method to do this? Delete the file completely? Or just empty > its content? Not sure there is a "best method". For simplicity I'd just delete it and let the logger recreat

Re: Deleting or Empty a File

2007-04-17 Thread Daniel Nogradi
> I'm looking to clear those log files we were discussing earlier chaps, > > > What the best method to do this? Delete the file completely? Or just empty > its content? If you just want to delete the content of a file but keep it with 0 length you can do: f = open( 'myfile', 'w' )# or open(

Deleting or Empty a File

2007-04-17 Thread Robert Rawlins - Think Blue
I'm looking to clear those log files we were discussing earlier chaps, What the best method to do this? Delete the file completely? Or just empty its content? Thanks, Rob -- http://mail.python.org/mailman/listinfo/python-list